www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: How to Play WindowsMedia within HTML page?

  1. #1
    Join Date
    Feb 2003
    Posts
    86

    How to Play WindowsMedia within HTML page?

    I'm not sure if this is the correct term to use...but how do you "stream"(???) or play an AVI file (whether in WM or RealPlayer or QT) in a particular position embedded within an HTML page? including the corresponding player's controls?

    For an example when I click on an image thumbnail, the avi or mpg file gets played in the middle of the page...say within a table or something

    TiA!
    Thanks in advance for any replies!
    Awic

  2. #2
    Join Date
    Sep 2003
    Posts
    283
    <embed src="" autostart="true" width="200" height="200"">

    autostart means that it starts when you load the page...

    This really only works for Quicktime and Windows Media and if it's sound you want to stream then you should really put in

    <bgsound src="" loop="infinite">

    if you want it to be the background sound...

  3. #3
    Join Date
    Feb 2003
    Posts
    86

    How to Play WindowsMedia within HTML page?

    I'm not sure if this is the correct term to use...but how do you "stream"(???) or play an AVI file (whether in WM or RealPlayer or QT) in a particular position embedded within an HTML page? including the corresponding player's controls?

    For an example when I click on an image thumbnail, the avi or mpg file gets played in the middle of the page...say within a table or something

    TiA!
    Thanks in advance for any replies!
    Awic

  4. #4
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,224
    Its very simple
    Code:
    <EMBED SRC="filename.???" loop="1" height="??" width="??" autostart="true"></EMBED>
    this will open in whatever the users defualt player is for that format. If its an avi or mpeg it will open in media player is its a .ram or something it will open in real player etc.

  5. #5
    Join Date
    Feb 2003
    Posts
    86
    Thanks for the replies.

    But....what if I dont want the video file to play immediately...but rather, start to play when I click on a particular link and only in a particular spot on the page. It's like having a "tv screen" within a page (it'd be nice to have the controls included)
    Last edited by Four_of_Five; 09-22-2003 at 02:19 PM.
    Thanks in advance for any replies!
    Awic

  6. #6
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,224
    To use the windows media start control put
    autostart="false"

  7. #7
    Join Date
    Feb 2003
    Posts
    86
    Originally posted by PeOfEo
    To use the windows media start control put
    autostart="false"
    Thanks...but it's not exactly what I'm looking for...

    ++++++++++BUMP++++++++

    I mean I know you can "insert" videos within webpages...that's easy enough (and even have the controls show up)..but how do you actually create/embed a "dynamic" video screen w/in a webpage that you can turn on and off (and change "channels") when different button/links are clicked within the page? It's basically like having a "TV screen" on the page....it's idle/standby until you "turn it on" and changes to other video files when you click another buttton.
    Thanks in advance for any replies!
    Awic

  8. #8
    Join Date
    May 2003
    Location
    Millis, MA
    Posts
    453
    Well, if you want to use multiple videos, you could make a page for each one, or you could use JavaScript. I think this might work:

    Code:
    <script type="text/javascript">
    funtion changeChannel(channel) {
        document.tv_screen.src = channel;
    }
    </script>
    Put that in the head of the page. Then add name="tv_screen" to the embed tag. In each link that will change the video, change the href to '#' and add onClick="changeChannel('video file name');". I think that's what you're looking for.
    isn't this profound...
    http://www.radioactiverabbit.com

  9. #9
    Join Date
    Feb 2003
    Posts
    86
    Originally posted by PunkSktBrdr01
    Well, if you want to use multiple videos, you could make a page for each one, or you could use JavaScript. I think this might work:

    Code:
    <script type="text/javascript">
    funtion changeChannel(channel) {
        document.tv_screen.src = channel;
    }
    </script>
    Put that in the head of the page. Then add name="tv_screen" to the embed tag. In each link that will change the video, change the href to '#' and add onClick="changeChannel('video file name');". I think that's what you're looking for.
    Hmmmm....this seems promising! Thanks a bunch!

    Actually, you also game me the idea of creating "multiple" page frames within a page...but I think your code might just work even a lot better.


    So how does this go?
    <body>
    <embed src="what do I put in here?" name="tv_screen">

    <a href="#" onClick="changeChannel('videofilename);">Video 1 </a > Is this right???

    Btw, Will this play the video in just one spot???


    Last edited by Four_of_Five; 09-25-2003 at 04:04 PM.
    Thanks in advance for any replies!
    Awic

  10. #10
    Join Date
    May 2006
    Location
    england
    Posts
    1

    3gp?

    Hiya is there any way that i can play 3gp videos on a html page without converting it to mpeg? is there another way to do it?
    thanks peter

  11. #11
    Join Date
    Apr 2006
    Location
    Ocean Springs Mississippi
    Posts
    29
    Quote Originally Posted by Four_of_Five
    I'm not sure if this is the correct term to use...but how do you "stream"(???) or play an AVI file (whether in WM or RealPlayer or QT) in a particular position embedded within an HTML page? including the corresponding player's controls?

    For an example when I click on an image thumbnail, the avi or mpg file gets played in the middle of the page...say within a table or something

    TiA!
    4 of 5,

    This is the code for embedding Windows media player into your html page. You'll have to play around with it to get the window on the page where you want it.

    Create an html page placing the following on the page...



    <OBJECT id="VIDEO"
    style="position:absolute; left:19;top:19;width:480px; height:360px"
    CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
    type="application/x-oleobject">

    <PARAM NAME="URL" VALUE="http://YOURSITE.COM/YOUR VIDEO NAME HERE.wmv" ref>
    <PARAM NAME="AutoStart" VALUE="-1">
    <PARAM name="uiMode" value="mini">
    <PARAM name="PlayCount" value="1">
    <param name="rate" value="1">
    <param name="balance" value="0">
    <param name="currentPosition" value="0">
    <param name="defaultFrame" value>
    <param name="currentMarker" value="0">
    <param name="invokeURLs" value="-1">
    <param name="baseURL" value>
    <param name="volume" value="80">
    <param name="mute" value="0">
    <param name="stretchToFit" value="1">
    <param name="windowlessVideo" value="0">
    <param name="enabled" value="-1">
    <param name="enableContextMenu" value="-1">
    <param name="fullScreen" value="0">
    <param name="SAMIStyle" value>
    <param name="SAMILang" value>
    <param name="SAMIFilename" value>
    <param name="captioningID" value>
    <param name="enableErrorDialogs" value="0">
    </OBJECT>

    Link to this html page with a link or a button. Change parameters of the blue text.
    Land of the Freebies
    http://planetdenn.com

  12. #12
    Join Date
    May 2006
    Posts
    4
    I think the best way to Play WindowsMedia within HTML page is using flash video, and on2 vp6 encoder has good quality.

    I just made a forum that what to learn flash video(flv) with someone who interest in flv.
    Last edited by jjack; 05-22-2006 at 10:45 AM.

  13. #13
    Join Date
    Apr 2006
    Location
    Ocean Springs Mississippi
    Posts
    29
    Quote Originally Posted by jjack
    I think the best way to Play WindowsMedia within HTML page is using flash video, and on2 vp6 encoder has good quality.

    I just found a forum that what to learn flash video(flv) with someone who interest in flv.
    jjack,

    I just went to your link and there is only one post on the entire site. How did you just find this place? There is certainly nothing informative on the subject. I'm guessing that this is your site and you’re out trying to find people to come to the site, and there is nothing wrong with that, but like I said... nothing there to help on the subject of embedding videos.
    Land of the Freebies
    http://planetdenn.com

  14. #14
    Join Date
    May 2006
    Posts
    4
    Oh, I'm sorry for my poor english,

    I mean I am the author of the forum, and want to talk with someone who interest in flv on that forum.

  15. #15
    Join Date
    Dec 2005
    Location
    Queen Creek, AZ
    Posts
    1,564
    All of the above is good and well, but what if they are not using IE?

    That object will not even show up in FF.

    A simple approach is to use an object for IE and an object for FF (this one 'inside' the IE object declaration).
    When IE loads the page, it will try and get the first object, and if it fails will try and get the second. FF works the same. It will fail to load the first object, but then load the second.

    Your approach is far too simple, and wrong.

    You don't need a different page for each move, you simply store the movie name and it's location in an array, or in a SELECT drop down, and then when they want to change movie, you stop the currently playing one, change the url of the object and play it.

    The methods you use to play depend on the version you use of media player.
    6.4 uses OBJECT.play() and OBJECT.stop(), whereas newer versions use OBJECT.controls.play() and OBJECT.controls.stop();

    Another pitfall to watch for is the different ways to load a movie depending on the browser.

    Hope this helps.
    Design first! Code later!

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
  •  
HTML5 Development Center



Recent Articles