943,015 Members | Top Members by Rank

Ad:
Nov 29th, 2009
0

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

Expand Post »
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 ....
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abah05 is offline Offline
3 posts
since Nov 2009
Nov 29th, 2009
0
Re: [Help Please] Embeeding and Control Windows Media Player with HTML/JavaScript
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.
Sponsor
Reputation Points: 299
Solved Threads: 357
WiFi Lounge Lizard
Airshow is offline Offline
2,517 posts
since Apr 2009
Nov 30th, 2009
0

Thank you for your advice.

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abah05 is offline Offline
3 posts
since Nov 2009
Nov 30th, 2009
0
Re: [Help Please] Embeeding and Control Windows Media Player with HTML/JavaScript
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.
Sponsor
Reputation Points: 299
Solved Threads: 357
WiFi Lounge Lizard
Airshow is offline Offline
2,517 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: jquery select box - assign value
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: creating a form page help plz. see attachment





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC