| | |
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:
Solved Threads: 0
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.
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.
0
#2 Oct 8th, 2009
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<OBJECT id="VIDEO" width="320" height="240" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="your file or url"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="True"> <PARAM name="uiMode" value="none"> <PARAM name="PlayCount" value="9999"> </OBJECT>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
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.
-1
#4 Oct 9th, 2009
•
•
•
•
that look great.
but can you tell me where to set it in?
shall it all go to body or???
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
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)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Windows Media Player</title> <style type="text/css"> #Player, input{width:400px;} p input{width:97px} </style> </head> <body> <INPUT TYPE="File" VALUE="Megamix.mp3" onChange="Player.URL = this.value"> <p> <INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.controls.play()"> <INPUT TYPE="BUTTON" VALUE="Stop" OnClick="Player.controls.stop()"> <INPUT TYPE="BUTTON" VALUE="Pause" OnClick="Player.controls.pause()"> <INPUT TYPE="BUTTON" VALUE="Full Screen" OnClick="if (Player.playState == 3) Player.fullScreen = 'true'"> </p> <p></p> <SCRIPT type="text/javascript"> if(-1 != navigator.userAgent.indexOf("MSIE")) { document.write('<OBJECT id="Player"'); document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"'); document.write(' width=300 height=200></OBJECT>'); } else if(-1 != navigator.userAgent.indexOf("Firefox")) { document.write('<OBJECT id="Player"'); document.write(' type="application/x-ms-wmp"'); document.write(' width=300 height=200></OBJECT>'); } </SCRIPT> </body> </html>
•
•
Join Date: Sep 2009
Posts: 22
Reputation:
Solved Threads: 0
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: im not good to that stuff but can u make something like that?
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)
<INPUT TYPE="URL" VALUE="http://mywebsite.dk/music/mymusic.mp3"
Last edited by digtokiller; Oct 14th, 2009 at 4:45 am. Reason: wrong spelling
1
#8 Oct 14th, 2009
Yes, you simply delete it!
Just change the play button code from:
•
•
•
•
and it play from a file uploaded to my website?
<INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.controls.play()"> into:<INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.URL='http://mywebsite.dk/music/mymusic.mp3'> •
•
Join Date: Sep 2009
Posts: 22
Reputation:
Solved Threads: 0
-1
#9 Oct 17th, 2009
that dont work but this work:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<INPUT TYPE="BUTTON" VALUE="Play" OnClick="Player.URL='http://mysite.my/mymusic/mysong.mp3'"> <INPUT TYPE="BUTTON" VALUE="Stop" onclick="Player.controls.stop()"> <INPUT TYPE="BUTTON" VALUE="Pause" onclick="Player.controls.pause()"> <INPUT TYPE="BUTTON" VALUE="Full Screen" onclick="if(Player.playState == 3) Player.fullScreen = 'true'"> <script type="text/javascript"> if(-1 != navigator.userAgent.indexOf("MSIE")) { document.write('<OBJECT id="Player"'); document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"'); document.write(' width=300 height=200></OBJECT>'); } else if(-1 != navigator.userAgent.indexOf("Firefox")) { document.write('<OBJECT id="Player"'); document.write(' type="application/x-ms-wmp"'); document.write(' width=300 height=200></OBJECT>'); } </script>
![]() |
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: looping through array
- Next Thread: Redirect if original website is not available
| Thread Tools | Search this Thread |
acacia adobe adoption aol audio bebo bing branding budgeting business cards chaos cios collaboration company comscore copying corporate count crime delphi digby digg e-learning e-mail ecommerce enterprise experiment facebook fail figures gadgets google googlesandbox government hacker historical holidays india interation internet ipod issues knowledge lawsuits legal leopard leveraging marshallmcluhan media microblogging microsoft monetization monitoring mp3 murdoch music networking news newspapers online patent player policy politics publishing radian6 real referrals running search security sharing small snow social socialnetworking socusoftwebvideoplayer software stories streaming success survey surveys television tips tweetdeck twitter uk video virtualization vista vmware web webvideoconverter webvideoplayer webvideoplayers windows xp zune






