Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Go Back   EduGeek.net Forums > Coding and Web Development > Coding
Reply
 
LinkBack Thread Tools Search Thread Language
Sponsored Links
Old 09-09-2008, 11:13 AM   #1
 
tomscaper's Avatar
 
Join Date: Jul 2006
Posts: 601
uk uk durham city
Thanks: 68
Thanked 8 Times in 8 Posts
Rep Power: 8 tomscaper is on a distinguished road
Default viewing video in new window

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
Code:
<object id='mediaPlayer' width="600" height="534" 
      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'>
      <param name='fileName' value="VIDEO FILE NAME.URL" />
      <param name='animationatStart' value='true' />
      <param name='transparentatStart' value='true' />
      <param name='autoStart' value="true" />
      <param name='showControls' value="true" />
      <param name='loop' value="false" />	  
    </object>
  Reply With Quote
Old 09-09-2008, 01:00 PM   #2
 
webman's Avatar
 
Join Date: Nov 2005
Location: County Durham
Posts: 5,668
uk uk durham city
Thanks: 105
Thanked 87 Times in 71 Posts
Blog Entries: 1
Rep Power: 38 webman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to all
Default

Try this:

Code:
<object id='mediaPlayer' width="600" height="534" 
      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'>
      <param name='fileName' value="" />
      <param name='animationatStart' value='true' />
      <param name='transparentatStart' value='true' />
      <param name='autoStart' value="true" />
      <param name='showControls' value="true" />
      <param name='loop' value="false" />	  
    </object>


<script type="text/javascript">
u1 = window.location.toString();
u2 = u1.split("#");
videofile = u2[1];
alert(videofile);
document.getElementById('mediaPlayer').fileName=videofile;
</script>
And link to the page like this:

playvideo.html#foobar.wmv

Where foobar.wmv is the video file you want it to load.
  Reply With Quote
The Following User Says Thank You to webman For This Useful Post:
tomscaper (09-09-2008)
Old 09-09-2008, 01:40 PM   #3
 
tomscaper's Avatar
 
Join Date: Jul 2006
Posts: 601
uk uk durham city
Thanks: 68
Thanked 8 Times in 8 Posts
Rep Power: 8 tomscaper is on a distinguished road
Default

Thanks for that was driving me nuts trying to fathom that one out.

I assume the line
Code:
alert(videofile);
Is what causes the pop up message box to show, so removing that would stop it.

Thanks again
Tom

Quote:
Originally Posted by webman View Post
Try this:

Code:
<object id='mediaPlayer' width="600" height="534" 
      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'>
      <param name='fileName' value="" />
      <param name='animationatStart' value='true' />
      <param name='transparentatStart' value='true' />
      <param name='autoStart' value="true" />
      <param name='showControls' value="true" />
      <param name='loop' value="false" />	  
    </object>


<script type="text/javascript">
u1 = window.location.toString();
u2 = u1.split("#");
videofile = u2[1];
alert(videofile);
document.getElementById('mediaPlayer').fileName=videofile;
</script>
And link to the page like this:

playvideo.html#foobar.wmv

Where foobar.wmv is the video file you want it to load.
  Reply With Quote
Old 09-09-2008, 02:02 PM   #4
 
webman's Avatar
 
Join Date: Nov 2005
Location: County Durham
Posts: 5,668
uk uk durham city
Thanks: 105
Thanked 87 Times in 71 Posts
Blog Entries: 1
Rep Power: 38 webman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to all
Default

Quote:
Originally Posted by tomscaper View Post
I assume the line
Code:
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
  Reply With Quote
The Following User Says Thank You to webman For This Useful Post:
tomscaper (09-09-2008)
Old 09-09-2008, 02:26 PM   #5
 
tomscaper's Avatar
 
Join Date: Jul 2006
Posts: 601
uk uk durham city
Thanks: 68
Thanked 8 Times in 8 Posts
Rep Power: 8 tomscaper is on a distinguished road
Default

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.
  Reply With Quote
Old 09-09-2008, 02:42 PM   #6
 
webman's Avatar
 
Join Date: Nov 2005
Location: County Durham
Posts: 5,668
uk uk durham city
Thanks: 105
Thanked 87 Times in 71 Posts
Blog Entries: 1
Rep Power: 38 webman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to allwebman is a name known to all
Default

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"
  Reply With Quote
The Following User Says Thank You to webman For This Useful Post:
tomscaper (09-09-2008)
Old 09-09-2008, 03:22 PM   #7
 
tomscaper's Avatar
 
Join Date: Jul 2006
Posts: 601
uk uk durham city
Thanks: 68
Thanked 8 Times in 8 Posts
Rep Power: 8 tomscaper is on a distinguished road
Default

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.

Quote:
Originally Posted by webman View Post
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"

Last edited by tomscaper; 09-09-2008 at 04:24 PM..
  Reply With Quote
Old 12-09-2008, 12:09 PM   #8
 
Friez's Avatar
 
Join Date: Dec 2006
Posts: 778
uk uk england
Thanks: 13
Thanked 13 Times in 12 Posts
Rep Power: 11 Friez has a spectacular aura aboutFriez has a spectacular aura about
Default

A PHP Solution:

To use: link to PlayVideo.php?playfile=yourvideofilehere.wmv

PlayVideo.php
PHP Code:

<object id='mediaPlayer' width="600" height="534" 
      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'>
      <param name='fileName' value="<?php echo $_GET['playfile']; ?>" />
      <param name='animationatStart' value='true' />
      <param name='transparentatStart' value='true' />
      <param name='autoStart' value="true" />
      <param name='showControls' value="true" />
      <param name='loop' value="false" />      
    </object>
  Reply With Quote
The Following User Says Thank You to Friez For This Useful Post:
tomscaper (12-09-2008)
Old 12-09-2008, 12:26 PM   #9
 
tomscaper's Avatar
 
Join Date: Jul 2006
Posts: 601
uk uk durham city
Thanks: 68
Thanked 8 Times in 8 Posts
Rep Power: 8 tomscaper is on a distinguished road
Default

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.
  Reply With Quote
Old 19-09-2008, 02:33 PM   #10
 
Marci's Avatar
 
Join Date: Jun 2008
Location: Wakefield, West Yorkshire
Posts: 37
uk
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0 Marci is an unknown quantity at this point
Default

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/...17&postcount=4

All you then have is a single page with list of subject areas that switches the playlist using javascript...

Last edited by Marci; 19-09-2008 at 02:39 PM..
  Reply With Quote
Reply

Register now for FREE and post messages!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Image Verification
  I agree to forum rules 

Similar Threads
Thread Thread Starter Forum Replies Last Post
Covering ourselves when it comes to policing porn viewing woody School ICT Policies 28 11-09-2007 09:40 PM
Viewing Network speckytecky Networks 4 30-08-2007 05:45 PM
Viewing network folders alonebfg Windows 2 02-07-2007 07:28 AM
Any free video to flash converters or ideas on video? Quackers Web Development 15 26-06-2007 03:23 PM
Viewing all of a member's posts eejit Comments and Suggestions 7 03-07-2005 12:26 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 09:05 PM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright EduGeek.net