www.webdeveloper.com
Results 1 to 9 of 9

Thread: Trying to get a video onto my page - failed ?

  1. #1
    Join Date
    Apr 2005
    Posts
    164

    Trying to get a video onto my page - failed ?

    Hi

    I have been trying to get a video onto my web page, playing with Windows Media Player, for the first time, but it will not work ? This is the code I've been using: The file is .avi file titled "me" and stored in my Mp3 folder. Can anyone see where I am going wrong ?

    Thanks for any help !

    <object width="320" height="290" id="mediaplayer1" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
    <param name="movie" value="mp3/me.avi" />
    <param name="Autostart" value="True" />
    <param name="Showcontrols" value="True" />
    <param name="ShowStatusBar" value="False" />
    <param name="ShowDisplay" value="False" />
    <param name="AutoRewind" value="True" />
    <embed type="application/x-mplayer2" width="320" height="290" src="mp3/me.AVI" filename="me.mpg" showcontrols="True"
    showstatusbar="False" showdisplay="False" autostart="True" autorewind="True" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/">
    </embed> </object>

  2. #2
    Join Date
    Oct 2013
    Posts
    484
    This works with a WMV file in IE11 (I couldn't find an AVI file on my computer ). Your mileage may vary.

    Code:
    <object id="MediaPlayer" width="320" height="290" type="video/x-ms-asf">
    <param name="FileName"value="mp3/me.avi">
    <param name="autostart" value="false">
    <param name="ShowControls" value="true">
    <param name="ShowStatusBar" value="false">
    <param name="ShowDisplay" value="false">
    <embed type="application/x-mplayer2" src="mp3/me.avi" 
    width="320" height="290" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0" />
    </object>
    Hint: me.avi and me.AVI are 2 different files to a non-Windows server. Adjust as necessary.

  3. #3
    Join Date
    Jul 2014
    Posts
    12
    Hi there ,I totally agree with Kevin2 because he is shearing with us such a Fabulous information,s not a only information,s that could be a very value able information,s ,so i want to thank him ......
    Regard Me:!

  4. #4
    Join Date
    Apr 2005
    Posts
    164
    Hi Kevin2. Thank you very much for taking the time to try and help, I appreciate it. I haven't had a chance to try out your code until today. I converted my avi file into .wmv - but I still cannot get it to work? I used your code and simply substituted .wmv for .avi When I preview my page in my Firefox browser I just get the message:

    'A plugin is needed to play this content'.

    Have you any idea what I am doing wrong here ?

    Thanks again.

  5. #5
    Join Date
    Oct 2013
    Posts
    484
    The only thing you are doing "wrong" is trying to play a file that uses a Microsoft video format in a non-Microsoft browser.

    So ya wanna make it work cross-browser, eh? First thing we need to do is get away from a proprietary format. You'll need to convert either the .avi file or the .wmv file to something like .mp4. I've used this online converter:
    http://video.online-convert.com/
    but if you have a converter on your computer that's up to the task by all means use it instead.

    Now we need to get away from the proprietary player (Windows Media Player). Fortunately, HTML5 allows non-proprietary files to be played "natively" in the browser. Let's assume you convert to MP4 and your file is now "me.mp4". Here we go:

    HTML Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>video display</title>
    </head>
    <body>
    
    <p>My cool video:</p>
    
    <video width="320" height="290" controls="controls"><source src="mp3/me.mp4" type="video/mp4"/></video>
    
    </body>
    </html>
    There's other attributes for the video tag, and ways of adding alternate file formats to it. You should look it up and see if any would help you.

    This doesn't work in IE8- but you can use the IE conditional statements to drop your WMP/AVI code into the page for those browsers -- if you even care about IE8...

  6. #6
    Join Date
    Apr 2005
    Posts
    164
    Kevin2 you are a GENIUS It works a treat v! Thank you so much for your help !

  7. #7
    Join Date
    Oct 2013
    Posts
    484
    Just a learner like you smoker .

    But you're very welcome!

  8. #8
    Join Date
    Apr 2005
    Posts
    164
    Quote Originally Posted by Kevin2 View Post
    Just a learner like you smoker .

    But you're very welcome!
    Nah, you are no 'learner' ! thanks again ;-)

  9. #9
    Join Date
    Oct 2013
    Posts
    484
    HAHA!

    I learned this video stuff only about 6 weeks ago. An example of the "teacher"'s knowledge staying barely ahead of the "student"'s!


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