+ Post New Thread
Results 1 to 10 of 10
Coding Thread, viewing video in new window in Coding and Web Development; Does anyone know of an easier way to do the following, we have a list of videos we want to ...
  1. #1
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22

    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>

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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.

  3. Thanks to webman from:

    tomscaper (9th September 2008)

  4. #3
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    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.

  5. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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

  6. Thanks to webman from:

    tomscaper (9th September 2008)

  7. #5
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    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.

  8. #6

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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"

  9. Thanks to webman from:

    tomscaper (9th September 2008)

  10. #7
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    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; 9th September 2008 at 04:24 PM.

  11. #8
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    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>

  12. Thanks to Friez from:

    tomscaper (12th September 2008)

  13. #9
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    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.

  14. #10
    Marci's Avatar
    Join Date
    Jun 2008
    Location
    Wakefield, West Yorkshire
    Posts
    895
    Thank Post
    84
    Thanked 235 Times in 194 Posts
    Rep Power
    82
    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; 19th September 2008 at 02:39 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Covering ourselves when it comes to policing porn viewing
    By woody in forum School ICT Policies
    Replies: 28
    Last Post: 11th September 2007, 09:40 PM
  2. Viewing Network
    By speckytecky in forum Wireless Networks
    Replies: 4
    Last Post: 30th August 2007, 05:45 PM
  3. Viewing network folders
    By alonebfg in forum Windows
    Replies: 2
    Last Post: 2nd July 2007, 07:28 AM
  4. Any free video to flash converters or ideas on video?
    By Quackers in forum Web Development
    Replies: 15
    Last Post: 26th June 2007, 03:23 PM
  5. Viewing all of a member's posts
    By eejit in forum Comments and Suggestions
    Replies: 7
    Last Post: 3rd July 2005, 12:26 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •