[Help Please] Embeeding and Control Windows Media Player with HTML/JavaScript

Reply

Join Date: Nov 2009
Posts: 3
Reputation: abah05 is an unknown quantity at this point 
Solved Threads: 0
abah05 abah05 is offline Offline
Newbie Poster

[Help Please] Embeeding and Control Windows Media Player with HTML/JavaScript

 
0
  #1
Nov 29th, 2009
Hi, I'm doing embedding Windows Media Player with the HTML
but I can not run the script through a different page.
The following script that I made:

file : player.html

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <OBJECT id="VIDEO" width="640" height="480"
  3. style="position:relatif; left:0;top:0;"
  4. CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
  5. type="application/x-oleobject">
  6.  
  7. <PARAM NAME="URL" VALUE="file_name.mpg">
  8. <PARAM NAME="SendPlayStateChangeEvents" VALUE="true">
  9. <PARAM NAME="AutoStart" VALUE="true">
  10. <PARAM name="uiMode" value="Full">
  11. <PARAM name="fullScreen" value="false">
  12. <PARAM name="balance" value="0">
  13. <PARAM name="volume" value="100">
  14. <PARAM name="stretchToFit" value="true">
  15. <PARAM name="PlayCount" value="1">
  16. </OBJECT>
  17.  
  18. <br><br>
  19.  
  20. <input type=submit name=play1 value="New File" onClick=document.getElementById('VIDEO').URL="new_file.mpg";>
  21. <input type=submit name=play2 value=Play onClick=document.getElementById('VIDEO').controls.play();>
  22. <input type=submit name=play3 value=Pause onClick=document.getElementById('VIDEO').controls.Pause();>
  23.  
  24. </html>

above is the script for embbeding and scripts to perform the control in Windows Media Player, the script above work well on IE not on Mozzila Firefox (why??), then I save the file with the name player.html

The next script I tried to separate the Windows Media Player control into a different file, for example control.html

file : control.html

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2.  
  3. <input type=submit name=play1 value="New File" onClick=document.getElementById('VIDEO').URL="new_file.mpg";>
  4. <input type=submit name=play2 value=Play onClick=document.getElementById('VIDEO').controls.play();>
  5. <input type=submit name=play3 value=Pause onClick=document.getElementById('VIDEO').controls.Pause();>
  6.  
  7.  
  8. </html>

but I can not control the files player.html, my question how do the control on different files (control.html to player.html )...???

for the help I thank you ....
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 895
Reputation: Airshow will become famous soon enough Airshow will become famous soon enough 
Solved Threads: 131
Airshow's Avatar
Airshow Airshow is offline Offline
Posting Shark
 
0
  #2
Nov 29th, 2009
You need a mechanism for putting control.html to player.html back together. There are several approaches:
  1. Server-side script : Recompose the page server-side - eg. PHP or SeverSide Includes (SSI).
  2. AJAX : Serve a page containing one component with JavaScript/ AJAX to fetch the other component and insert it dynamically into the DOM.
  3. Inline frame : Serve a page containing one component with an inline frame containing the other component.
(1) is by far the easiest and the one I recommend if available to you.

(2) Not too difficult if you already know AJAX/DOM scripting. Otherwise it will take a little time to master a couple of things.

(3) A bit messy as the controls need to communicate into (or out of) an inline frame. I've done this sort of stuff in the past and it's not so bad once you've got your mind round what is effectively window-window addressing. However, I suggest this is the least attractive of the options.

Hope this helps.

Airshow
Last edited by Airshow; Nov 29th, 2009 at 1:10 pm.
50% of the solution lies in accurately describing the problem!
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: abah05 is an unknown quantity at this point 
Solved Threads: 0
abah05 abah05 is offline Offline
Newbie Poster

Thank you for your advice.

 
0
  #3
Nov 30th, 2009
Thank you for your advice.

I've tried with AJAX Updater, which is my goal to make a file in order to control the player.html files, but I can not take back the value of a variable.

if you please ... Can you give me a little bit example, I've been working for 2 months but did not work very well.

thanks before
Your help is my hope
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 895
Reputation: Airshow will become famous soon enough Airshow will become famous soon enough 
Solved Threads: 131
Airshow's Avatar
Airshow Airshow is offline Offline
Posting Shark
 
0
  #4
Nov 30th, 2009
I have just done some research and the web is full of people's problems with Windows Media Player in Firefox 3.

Firefox needs a plugin but it seems it doesn't always install very reliably.

I think that the plugin may be the main reason for your failure to get WMP woking in Firefox. I have just tried and can't get it to work here either.

Maybe try embedding QuickTim instead. I'm not sure how to do this but from what I've read it is more reliable - at least in Firefox.

Sorry I can't be more positive.

Airshow
Last edited by Airshow; Nov 30th, 2009 at 6:49 pm.
50% of the solution lies in accurately describing the problem!
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum


Views: 845 | Replies: 3
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC