5

I would like to embed mpg (dvd compliant mpeg2) movie files to my web page. I do not have any chance to convert these videos to any other format. This web is only for personal use so any type of solution would be perfect.

Really appriciate any advice or solution.

Here is my code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<embed src="my_video.mpg" autostart="false" height="350" width="500" />

</body>
</html>

SOLVED:

My solution for this problem was that i had to reinstall the wmp plugin for my browsers and its working fine

Wermerb
  • 1,039
  • 3
  • 15
  • 30
  • You do know there is a ` – tkone Apr 04 '12 at 11:42
  • 3
    You do know that – Wermerb Apr 04 '12 at 11:49
  • In what browser? Several browsers use whatever underlying files the system supports (safari comes to mind -- whatever QuickTime supports the browser will playback. This is why you can make an ogg file play back in a video tag on safari) – tkone Apr 04 '12 at 11:52
  • I tried it in ie and firefox. And it's wrote to me that not supported mime type – Wermerb Apr 04 '12 at 11:55
  • I didn't say it would work in ie or Firefox. Safari happens to implement this. I'm not positive that it'll do the same on windows, but it might. Regardless, if you need it to work in ff/ie you're going to need to embed a player with this functionality. You can embed windows media player in both ff and ie. I suggest looking into that – tkone Apr 04 '12 at 11:58

2 Answers2

2
<video width="500px" height="350px" autobuffer="autobuffer" autoplay="autoplay" loop="loop" controls="controls">
    <source src='my_video.mpg' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>

Source

Video tag specification

afaf12
  • 5,163
  • 9
  • 35
  • 58
1

Try this (Works with IE)

<EMBED SRC="movie.mpg" AUTOPLAY=true WIDTH=160 HEIGHT=120></EMBED>

edit: Hmmm that works for me. You can try this as an alternative:

<object id="MediaPlayer1" 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" width="280" height="256">
<param name="fileName" value="your_file.mpg">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="true">
<param name="Volume" value="-450">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="your_file.mpg" name="MediaPlayer1" width=280 height=256 autostart=1 showcontrols=1 volume=-450>
</object>

Also make sure you have the right codecs installed on your PC

Dumbo
  • 13,555
  • 54
  • 184
  • 288
  • it's not working for me unfortunately. It's loading though the windows media player but cannot play the video. I've already checked the are in the same folder – Wermerb Apr 04 '12 at 11:33
  • i think i have the right codec for the player because i can play the video on windows media player – Wermerb Apr 04 '12 at 12:12
  • How do you control the embed with javascript with this method? – Cruncher Jan 13 '14 at 15:09
  • @Cruncher Waht do you mean control it by JS? what kind of control? – Dumbo Jan 14 '14 at 23:25
  • @Sean87 Play, Stop, change source. It turned out though that I could call all of the methods on the object itself – Cruncher Jan 15 '14 at 16:17