Change source with javascript?

4 replies [Last post]
weeandykidd
weeandykidd's picture
User offline. Last seen 2 years 40 weeks ago. Offline
Joined: 05/02/2009
Posts: 3
Groups: None

Hi.
Is there anyway I can have the web player playing a file defined by a javascript function?

weeandykidd
weeandykidd's picture
User offline. Last seen 2 years 40 weeks ago. Offline
Joined: 05/02/2009
Posts: 3
Groups: None
Bump

Anyone know how to do this?

Webmasters SDK

Did you check out any of the examples in the Webmaster SDK?

http://download.divx.com/player/DivXWebPlayer_WebmasterSDK.zip

weeandykidd
weeandykidd's picture
User offline. Last seen 2 years 40 weeks ago. Offline
Joined: 05/02/2009
Posts: 3
Groups: None
I've scoured through the SDK

I've scoured through the SDK now and all I've gained is a sore head, I've tried everything I can think of.
The reason I want this is so I can have a structure like
me.com/watch#file.avi

I can get the file .avi using the js function:
document.getElementById('comments').value = String(location.hash).substring(1);

But I can't use that as a source file because DivX doesn't run on javascript

FrogLand
FrogLand's picture
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 06/30/2008
Posts: 9
Groups: None
DivxPlayer + Javascript

Hi,

If you want to play with the divx player and javascript, create
the object / embed with all parameters you need through javascript and insert into the Dom.

Something like :

HTML : Create a target div :

<div id='target'></div>

JAVASCRIPT : Create the player / DOM insertion

var video_filename='myvideo.avi';
var string=[];
string.push('<object id=\'divxobj_ie\' classid=.....');
string.push('<param name=\'src\' value=\' '+video_filename+' \' />');
string.push('<param ....');
string.push('<embed id=\'divxobj_np\' ...');
string.push('</embed></object>');
document.getElementById('target').innerHTML = string.join('');

Integrate all params / callbacks you want ( check the SDK for more informations ).

Hope this help,

Regards,

Jeff

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.