Go
Not registered? Sign up!

BUFFER ModelListener doesn't work

Google Translate
8 posts | return to the JavaScript Interaction forum | get the rss feed for this thread

Oct. 20, 2009dwd

hi, i have a prob:

<script type="text/javascript">
var player = null;
function playerReady(obj) {
player = document.getElementById(obj.id);
addL();
};
function addL() {
if (player) {
if (typeof player.addModelListener == 'function') {
player.addModelListener('STATE', 'stateL');
player.addModelListener('BUFFER', 'bufferL');
}
} else {
setTimeout('addL()', 100);
}
}
function bufferL(params) {
alert('DEBUG BUFFER PERCENTAGE '+params.percentage);
if (params.percentage == 100)
alert('delvid buf');
}
function stateL(params) {
if (params.newstate == 'COMPLETED')
alert('delvid sta');
}

window.onload = function() {
var so = new SWFObject('a.swf', 'pl', '720', '380', '9');
so.addParam('allowscriptaccess', 'always');
so.addParam('allowfullscreen', 'true');
so.addParam('flashvars', 'config=a.xml');
so.write('a');
};
</script>

the 'DEBUG'.. alert never shows, so the bufferL() never called
why and how can i solve?

thanks

Oct. 20, 2009hobbs

Retreat backwards to a v4.6.341 player.

Oct. 25, 2009dwd

it's working, thank you!

BUT
i want to delete the php-generated temporary video after the playback ending or the user leaves the site.

please tell me how can i do this?!

thank you

Oct. 25, 2009Zachary Ozer

Your server is generating that file - the player has no way to delete it.

Oct. 27, 2009dwd

ajax?

Oct. 28, 2009Zachary Ozer

You can use AJAX to communicate with the server, but something on the server itself will have to delete the file.

This is not recommended as there is a huge security risk.

Nov. 07, 2009dwd

any idea?

Nov. 16, 2009Zachary Ozer

This is not something we support

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.