...

View Full Version : Controlling two windows media player embedded videos using a single button



cmaciel
07-21-2008, 08:13 PM
Hello,
Does anybody know how can I control playback/pause, etc in a webpage for two videos playing simultaneously? I want to play them synchronized, and whenever I press Pause, it applies to both at the same time. Same for other controls. Videos are local files, and the page is client-side only. Any suggestions in javascript/ajax/Flex/DHTML/etc?
Thanks
Cesar

mjlorbet
07-21-2008, 10:36 PM
http://msdn.microsoft.com/en-us/library/ms930697.aspx

is a link with the information about the activex control that you would use on your web page to play media content with windows media player. the functions documented in the page can be called via javascript, on click of a button (not one on the control, as the buttons on the control itself are bound to internal functions). i would suggest hiding the normal buttons on each control, and creating your own buttons to handle the synchronized operations (calling the same, corresponding, function on each of the objects instantiating the windows media player activex control).

Example:


function pause_onclick(){
document.getElementById("player1").Pause();
document.getElementById("player2").Pause();
}

cmaciel
07-22-2008, 12:43 AM
Thanks a lot. I had to use
document.getElementById("player1").controls.Pause(); (insert .controls.) for some reason, but it did exactly what I was looking for. Many thanks!
Cesar



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum