View Full Version : Is there a Javascript person in the house
Sticks
04-April-2005, 05:45 AM
I have prepared a number of wmv movie files which have a central linking theme.
They had to be separate files due to file size issues
Is there a way to do an embed in Javascript, such that one wmv file can be called after the other has finished on the same page?
Or is there a way to use a drop down menu, say, to select which file to be embeded.
I realise for the second one it could be easier to write a page for each file and have an index page, even using frames, but I thought it would be interesting to do it on one page.
sidmel
04-April-2005, 05:24 PM
The answer to your questions is yes to both. I'm not a javascript guru, but I use a lot of cookie cutter code in the sites that I design. I would check out a couple of free java script and php sites.
Java: http://javascript.internet.com
A little of everything (and great resource): http://www.hotscripts.com
The following is an example of something I did using nothing more than an inline frame which may work for what you are doing. Take a look at the package selections about halfway down the page.
http://www.weelectyou.com/supplies.html
Sticks
06-April-2005, 09:36 AM
After giving up on trying to get document.embeds[0]. etc... to work I have gone for the inline frame and a select a movie option, which works well
thanks for pointing that one out to me, I may make further use of it later
This is for a sort of post production CD-ROM of a series of events we held. A sort of souvenier to be mailed / given out to interested parties. Hence I wanted it to look as slick and as professional as I could make it.
However I have run in to some awkward problems
I wanted a folder structure where the video files (wmv format) are in a subfolder hanging off of a root. Hanging off of the same root would be a subfolder holding the html pages.
This worked on my works computer, the <embed> was able to go up across and down, as it were and play the movie. On my PC at home, it does not like to go up, so I had to move the html pages in which I embed the wmv files, into the same sub folder as the wmv files. I did check my version of Windows media player and it is up todate on all updates.
The works version of Windows Media player is version 8, at home I have version 10
Why the diference in behaviour, even though I have a more up to date version :-?
The next problem I had, is that I tried to run what I had done through Mozilla firefox as an alternate platform to IE. Whilst FireFox would play wmv files I placed on the net, such as this one (http://www.gsne03768.pwp.blueyonder.co.uk/apollo.htm) it would not play any of the ebeded wmv files on my hard drive. I just got the Media player viewer and a black screen
Any clues?
Also another trick I would like to do is that after the selected movie has finished playing I would like the inline framed page to be replaced by a page with an image, i.e the one they get when they first opened the web page.
I know I could get the effect by making the page that embeds the wmv file into a redirecting page with a delay equal to the length of the movie, but that would not take into account the possibility of the movie running slower due to a PC memory problem
Any ideas?
Sticks
07-April-2005, 08:03 AM
I did another test with Mozilla Firefox last night
It played the wmv file from this page (http://www.gsne03768.pwp.blueyonder.co.uk/apollo.htm) when I looked at it on the net, but when I looked at the same page that sits as a mirror site on my hard drive, Firefox would not play it.
Any ideas?
I need to be able to test these pages both in IE and firefox, since Firefox is growing in popularity
PS any thoughts on the other issue I mentioned previously, like how can a web page "know" when an embeded media file has finished playing?
sidmel
07-April-2005, 03:40 PM
I know I could get the effect by making the page that embeds the wmv file into a redirecting page with a delay equal to the length of the movie, but that would not take into account the possibility of the movie running slower due to a PC memory problem
I know most of the scripts use an onload function. Maybe you can take the onload function out and change it with a call that is iniated after the end of the movie and set the delay time to 1 (basically telling it to immediatelly forward?
I'll do some research and see what I come up with.
sidmel
07-April-2005, 05:09 PM
I think this is a freeware application that may be of interest. Link to the hotscripts download and discription and to their home page.
http://www.hotscripts.com/Detailed/44960.htmlhttp://minimaldesign.net/other?sub=mgallery
An interesting bit of Javascript that you be able to convert for your video display.
http://javascript.internet.com/miscellaneous/gallery-viewer.html
** Edited to fix html link
sidmel
07-April-2005, 05:58 PM
I wanted a folder structure where the video files (wmv format) are in a subfolder hanging off of a root. Hanging off of the same root would be a subfolder holding the html pages.
This worked on my works computer, the <embed> was able to go up across and down, as it were and play the movie. On my PC at home, it does not like to go up, so I had to move the html pages in which I embed the wmv files, into the same sub folder as the wmv files. I did check my version of Windows media player and it is up todate on all updates.
Sorry to keep posting in small bits, but things don't always occur to me at the same time.
Looking at your script, part of the problem with you folder options might be due to the linking termonology. I've ran across the same problem using css in a subfolder and using image calls.
Instead of using video/video_name.wvm, you might try one of the following structures:
src="..//video/video_name.wvm
This tells the browser to find the video not html subfolder, but to back out to the root folder and then look for the video in the video subfile.
Sticks
07-April-2005, 06:18 PM
Instead of using video/video_name.wvm, you might try one of the following structures:
src="..//video/video_name.wvm
Just tried this and it did not work :(
Re the OnLoad stuff, the way to do a redirection page is with HTML, as this example from a previous presentation CD-ROM shows
<meta http-equiv="Refresh" content="7; URL=flash/june2004-01.htm">
Am not certain how this could be linked with an OnLoad which is part of javascript event handling
:-?
sidmel
07-April-2005, 06:33 PM
One last thing I've found:
URL Flipping (from Microsoft tech library) using defaultFrame
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/paramtags.asp
Using media streaming and default frames:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/paramtags.asp
You'll also see an extensive database on the right of these pages that have other interesting stuff, such as creating playlists and managing them.
sidmel
07-April-2005, 06:38 PM
Instead of using video/video_name.wvm, you might try one of the following structures:
src="..//video/video_name.wvm
Just tried this and it did not work :(
Re the OnLoad stuff, the way to do a redirection page is with HTML, as this example from a previous presentation CD-ROM shows
<meta http-equiv="Refresh" content="7; URL=flash/june2004-01.htm">
Am not certain how this could be linked with an OnLoad which is part of javascript event handling
:-?
Sorry, I added one to many slashes.
Try src="../video/video_name.wmv
Once, again, sorry about that.
sidmel
07-April-2005, 06:44 PM
Instead of using video/video_name.wvm, you might try one of the following structures:
src="..//video/video_name.wvm
Just tried this and it did not work :(
Re the OnLoad stuff, the way to do a redirection page is with HTML, as this example from a previous presentation CD-ROM shows
<meta http-equiv="Refresh" content="7; URL=flash/june2004-01.htm">
Am not certain how this could be linked with an OnLoad which is part of javascript event handling
:-?
Sorry, I added one to many slashes.
Try src="../video/video_name.wmv
Once, again, sorry about that.
Sticks
07-April-2005, 06:55 PM
On trying that, it does not work
Right clicking on the player gave as part of the menu - Error details
It said
C00D132B: Cannot play the file
Windows Media Player cannot play the file. You might encounter this error message for the following reason:
The file that you are trying to play is stored in a location that the Player cannot access. Typically, this occurs when the path for a link on a Web page was created in a manner that is not supported by the embedded Player.
The file is either located in a folder above the location of a Web page containing the Windows Media Player ActiveX control or the file is in a folder above the location of a playlist (a Windows Media file with an .asx extension) that is referencing it. The Player does not support using relative paths to access folders above the current one.
To fix the problem, the Web page creator should modify the path to the file so that the file is located in a folder that the Player can access. For example, the path should not include the format "..\".
Error ID = 0xC00D132B, Condition ID = 0x00000000
Which was where I came in on this bug bear :(
sidmel
07-April-2005, 08:34 PM
Ouch, doesn't support relative paths. That's a bummer. The only way then, will be to move everything into the same directory like you've done or code in hard paths like:
http://www.yoursite.com/video/video_name.wmv
vBulletin® v3.8.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by
vBSEO 3.0.0