Mediaplayer question

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Sep 2009
Posts: 22
Reputation: digtokiller is an unknown quantity at this point 
Solved Threads: 0
digtokiller digtokiller is offline Offline
Newbie Poster

Mediaplayer question

 
0
  #1
Oct 8th, 2009
Hello all, i need a movie/mediaplayer and i could imagine that it would be in javascript.
all it should be able to do is to play mp3(music) and wmv(movie) files.
it need a start,stop,pause and fullscreen button.
anyone can give me a code just to place in my page?
thnx to everyone where want to help.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #2
Oct 8th, 2009
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <OBJECT id="VIDEO" width="320" height="240"
  2. style="position:absolute; left:0;top:0;"
  3. CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
  4. type="application/x-oleobject">
  5.  
  6. <PARAM NAME="URL" VALUE="your file or url">
  7. <PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
  8. <PARAM NAME="AutoStart" VALUE="True">
  9. <PARAM name="uiMode" value="none">
  10. <PARAM name="PlayCount" value="9999">
  11. </OBJECT>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. obj = document.getElementById("VIDEO");

SCRIPTING control Code Parameters Description
obj.Settings.autoStart true Specifies or retrieves a value indicating whether the current media item begins playing automatically.
obj.Settings.baseURL Specifies the base URL used for relative path resolution with URL script commands that are embedded in media items.
ClosedCaption.captioningID 0 Specifies the name of the element displaying the captioning.
obj.Controls.currentMarker 0 Specifies the current marker number.
obj.Controls.currentPosition 0 Specifies the current position in the media item in seconds.
obj.Settings.defaultFrame - Specifies the name of the frame used to display a URL.
obj.enableContextMenu true Specifies a value indicating whether to enable the context menu, which appears when the right mouse button is clicked.
obj.enabled false Specifies whether the Windows Media Player control is enabled.
obj.fullScreen false Specifies whether video content is played back in full-screen mode.
obj.Settings.invokeURLs true Specifies a value indicating whether URL events should launch a Web browser.
obj.Settings.mute false Specifies if audio is muted.
obj.Settings.PlayCount 1 Specifies the number of times a media item will play. Minimum value of one.
obj.Settings.rate 1.0 Specifies the playback rate.
0.5 equates to half the normal playback speed, 2 equates to twice.
obj.stretchToFit false Specifies whether video displayed by the control automatically sizes to fit the video window, when the video window is larger than the dimensions of the video image.
obj.uiMode full Specifies which controls are shown in the user interface.
Possible values: invisible, none, mini, full.
obj.URL - Specifies the name of the media item to play.
You can specify a local filename or a URL.
obj.Settings.volume Last setting Zero specifies no volume and 100 specifies full volume.
obj.Settings.balance false Set balance between left and right speakers. 0 is egual, -100 is full left and 100 is full right.
obj.windowlessVideo false Specifies or retrieves a value indicating whether the Windows Media Player control renders video in windowless mode.
When windowlessVideo is set to true, the Player control renders video directly in the client area, so you can apply special effects or layer the video with text.
Supported by Windows Media Player for Windows XP or later.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 22
Reputation: digtokiller is an unknown quantity at this point 
Solved Threads: 0
digtokiller digtokiller is offline Offline
Newbie Poster
 
0
  #3
Oct 9th, 2009
that look great.
but can you tell me where to set it in?
shall it all go to body or???
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
-1
  #4
Oct 9th, 2009
Originally Posted by digtokiller View Post
that look great.
but can you tell me where to set it in?
shall it all go to body or???
The topmost code is hard coded html meaning it is html;
the second one is a scripting syntax meaning it has to go inside the <script> tag.
That line will store reference to the player object in the variable named obj there.
Now obj is the public name of the player - from now one you call it "obj" and it will respond.

The rest is scripting handles that you can use to manipulate your player.
the most important one is:
[your player].URL part. With it you specify the file to play.
declaring:
obj.URL = "myvideo.wmv" will switch from previous to playing myvideow.wmv file.

etc etc
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 22
Reputation: digtokiller is an unknown quantity at this point 
Solved Threads: 0
digtokiller digtokiller is offline Offline
Newbie Poster
 
0
  #5
Oct 9th, 2009
ok... but all i need is a fullscreen button.
and a start,stop and pause button.
and im not good to this so if you just could tell me what i shall place where it would help a lot.
so what to place in "head" and what to place in "body"
so it give that i told i need.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
1
  #6
Oct 13th, 2009
This is interesting ....[?!?] still haven't found anything working for you on internet?!
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3.  
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  7. <title>Windows Media Player</title>
  8. <style type="text/css">
  9. #Player,
  10. input{width:400px;}
  11. p input{width:97px}
  12. </style>
  13. </head>
  14. <body>
  15. <INPUT TYPE="File" VALUE="Megamix.mp3" onChange="Player.URL = this.value">
  16. <p>
  17. <INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.controls.play()">
  18. <INPUT TYPE="BUTTON" VALUE="Stop" OnClick="Player.controls.stop()">
  19. <INPUT TYPE="BUTTON" VALUE="Pause" OnClick="Player.controls.pause()">
  20. <INPUT TYPE="BUTTON" VALUE="Full Screen" OnClick="if (Player.playState == 3)
  21. Player.fullScreen = 'true'">
  22. </p>
  23. <p></p>
  24.  
  25. <SCRIPT type="text/javascript">
  26. if(-1 != navigator.userAgent.indexOf("MSIE"))
  27. {
  28. document.write('<OBJECT id="Player"');
  29. document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
  30. document.write(' width=300 height=200></OBJECT>');
  31. }
  32. else if(-1 != navigator.userAgent.indexOf("Firefox"))
  33. {
  34. document.write('<OBJECT id="Player"');
  35. document.write(' type="application/x-ms-wmp"');
  36. document.write(' width=300 height=200></OBJECT>');
  37. }
  38. </SCRIPT>
  39. </body>
  40. </html>
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 22
Reputation: digtokiller is an unknown quantity at this point 
Solved Threads: 0
digtokiller digtokiller is offline Offline
Newbie Poster
 
0
  #7
Oct 14th, 2009
1. that looks perfect.
2. can you do so the upload thing disapear and it play from a file uploaded to my website?
something like:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <INPUT TYPE="URL" VALUE="http://mywebsite.dk/music/mymusic.mp3"
im not good to that stuff but can u make something like that?
Last edited by digtokiller; Oct 14th, 2009 at 4:45 am. Reason: wrong spelling
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
1
  #8
Oct 14th, 2009
Originally Posted by digtokiller View Post
can you do so the upload thing disapear
Yes, you simply delete it!
and it play from a file uploaded to my website?
Just change the play button code from:
<INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.controls.play()"> into:
<INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.URL='http://mywebsite.dk/music/mymusic.mp3'>
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 22
Reputation: digtokiller is an unknown quantity at this point 
Solved Threads: 0
digtokiller digtokiller is offline Offline
Newbie Poster
 
-1
  #9
Oct 17th, 2009
that dont work but this work:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.URL='http://mysite.my/mymusic/mysong.mp3'">
  2. <INPUT TYPE="BUTTON" VALUE="Stop" onclick="Player.controls.stop()">
  3. <INPUT TYPE="BUTTON" VALUE="Pause" onclick="Player.controls.pause()">
  4. <INPUT TYPE="BUTTON" VALUE="Full Screen" onclick="if(Player.playState == 3) Player.fullScreen = 'true'">
  5.  
  6. <script type="text/javascript">
  7.  
  8. if(-1 != navigator.userAgent.indexOf("MSIE"))
  9.  
  10. {
  11.  
  12. document.write('<OBJECT id="Player"');
  13.  
  14. document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
  15.  
  16. document.write(' width=300 height=200></OBJECT>');
  17.  
  18. }
  19.  
  20. else if(-1 != navigator.userAgent.indexOf("Firefox"))
  21.  
  22. {
  23.  
  24. document.write('<OBJECT id="Player"');
  25.  
  26. document.write(' type="application/x-ms-wmp"');
  27.  
  28. document.write(' width=300 height=200></OBJECT>');
  29.  
  30. }
  31.  
  32. </script>
Reply With Quote Quick reply to this message  
Reply

Tags
media, player

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC