tomscaper Posted September 9, 2008 Posted September 9, 2008 Does anyone know of an easier way to do the following, we have a list of videos we want to open up in a new webpage currently we have the index page with link to 3 seperate video pages video1.html video2.html etc. Would there be an easier way to pass the video file name to a blank hmtl page rather than creating a sperate one for each. Code using to embed the video file into IE classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
webman Posted September 9, 2008 Posted September 9, 2008 Try this: classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <br /> u1 = window.location.toString();<br /> u2 = u1.split("#");<br /> videofile = u2[1];<br /> alert(videofile);<br /> document.getElementById('mediaPlayer').fileName=videofile;<br /> And link to the page like this: playvideo.html#foobar.wmv Where foobar.wmv is the video file you want it to load. 1
tomscaper Posted September 9, 2008 Author Posted September 9, 2008 Thanks for that was driving me nuts trying to fathom that one out. I assume the line alert(videofile); Is what causes the pop up message box to show, so removing that would stop it. Thanks again Tom Try this: classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <br /> u1 = window.location.toString();<br /> u2 = u1.split("#");<br /> videofile = u2[1];<br /> alert(videofile);<br /> document.getElementById('mediaPlayer').fileName=videofile;<br /> And link to the page like this: playvideo.html#foobar.wmv Where foobar.wmv is the video file you want it to load.
webman Posted September 9, 2008 Posted September 9, 2008 I assume the line alert(videofile); Is what causes the pop up message box to show, so removing that would stop it. Thanks again Tom Yep that's right. Used for debugging, forgot to remove it before posting 1
tomscaper Posted September 9, 2008 Author Posted September 9, 2008 You wouldnt happen to know how to set something like that up for a flv/swf file. Also i noticed it only loads the file is the playvideo.html file is in the same folder as the video. Would there any way incorporating the javascript window.open somehow, am googling for answers but its pretty complicated.
webman Posted September 9, 2008 Posted September 9, 2008 For flash you can use SWFObject which is javascript as well, so you can do a similar thing to above. You might be able to specify the full URL/path of the video but I haven't tested that. Eg. playvideo.html#../directoryabove/videos/foo.wmv playvideo.html#file:///p:/videos/bar.wmv To open in a new window, you could have links that use window.open, and set the URL of that to be "playvideo.html#foobar.wmv" 1
tomscaper Posted September 9, 2008 Author Posted September 9, 2008 (edited) Had a go altering the links to load elswhere but no joy. Just looking in to the window.open now to figure out how to do that. For flash you can use SWFObject which is javascript as well, so you can do a similar thing to above. You might be able to specify the full URL/path of the video but I haven't tested that. Eg. playvideo.html#../directoryabove/videos/foo.wmv playvideo.html#file:///p:/videos/bar.wmv To open in a new window, you could have links that use window.open, and set the URL of that to be "playvideo.html#foobar.wmv" Edited September 9, 2008 by tomscaper
Friez Posted September 12, 2008 Posted September 12, 2008 A PHP Solution: To use: link to PlayVideo.php?playfile=yourvideofilehere.wmv PlayVideo.php classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> 1
tomscaper Posted September 12, 2008 Author Posted September 12, 2008 Thanks for that. Currently what we have is a few webpages which are located on a share on the network, which loads on start up, depending on the time, which is set between 8 - 10am. The teachers can then click and load the different videos. As the video clips change constantly, i had to alter each page, and was looking for a simple solution. Webman's solution allows me to now not need to create each seperate page and link a video in, i can now have one page and link each video to that page, although where ever the video clips are saved, the playvideo.html file has to be located in a the same folder. What i would like but i have no idea how to do this, so if anyone has any ideas. To have 1 page with 3 links on them to 3 videos. Each link will create a new webpage which would have the embedded video clip inside. I assume there would be some way using javascript, but it is far past my knowledge.
Marci Posted September 19, 2008 Posted September 19, 2008 (edited) Have a look at JWPLayer for flv / swf etc (well, covers many formats) JW FLV Media Player For a complete(ish) system that simply requires you to ftp the video file into a folder (or even less than that - the system does everything if filesize is below 100Mb) see my post yonder: http://www.xtremesystems.org/forums/showpost.php?p=3160117&postcount=4 All you then have is a single page with list of subject areas that switches the playlist using javascript... Edited September 19, 2008 by Marci
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now