6

i have made some demo movies in WMV format that i want to embed in my html page. I've found some code to do that, but one thing annoys me: it shows a black front in stead of a picture of the first frame. And i can ofcourse put some descriptive text around the frames/movies, but it isn;t such a nice sight: all black squares with a play button beneath it. What do i have to do to show a (first) frame of the movie?

This is my code:

classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsm p2inf.cab#Version=6,4,7,1112"> 
<param name="filename" value="http://www.ladieda.com/mymovie.wmv"> 
<param name="autoStart" value="false"> 
<param name="showControls" value="true"> 
<param name="AllowChangeDisplaySize" value="true"> 
<param name="ClickToPlay" value="true"> 
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="http://www.ladieda.com/mymovie.wmv" AutoStart="false" ></embed>
</object>

Michel

Ps tried it in IE8 and FF3.6, both showed up black.

Michel
  • 23,085
  • 46
  • 152
  • 242

2 Answers2

9

My example works.

<object id='mediaPlayer' width="320" height="285" 
      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="http://www.ladieda.com/mymovie.wmv">
      <param name='animationatStart' value='true'>
      <param name='transparentatStart' value='true'>
      <param name='autoStart' value="false">
      <param name='showControls' value="true">
      <param name='loop' value="true">
      <embed type='application/x-mplayer2'
        pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
        id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
        bgcolor='darkblue' showcontrols="true" showtracker='-1' 
        showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
        src="http://www.ladieda.com/mymovie.wmv" autostart="true" designtimesp='5311' loop="true">
      </embed>
      </object>

Your example was modified to work:

<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsm p2inf.cab#Version=6,4,7,1112"> 
<param name="fileName" value="http://www.ladieda.com/mymovie.wmv"> 
<param name="autoStart" value="false"> 
<param name="showControls" value="true"> 
<param name="AllowChangeDisplaySize" value="true"> 
<param name="ClickToPlay" value="true"> 
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="http://www.ladieda.com/mymovie.wmv" autoStart="false" ></embed>
</object>

And yes, it works both on Firefox 3.6 and IE8 (I tested it myself).

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
  • Hi, i've uploaded a live sample, but still a black rectangle here: http://www.verfrisser.net/tst/test2.html – Michel Mar 29 '10 at 18:45
  • They do give a preview image in windows explorer. – Michel Mar 29 '10 at 19:00
  • they are movies from a Flip video camera, which are natively MP4 – Michel Mar 29 '10 at 19:02
  • Strange, I can see the player. The reference to the file "http://www.ladieda.com/mymovie.wmv" doesn't exist (and I tested using VLC and WMPlayer 11) – Buhake Sindi Mar 29 '10 at 20:03
  • Windows Media Player cannot play MP4 format if I'm not mistaken. – Buhake Sindi Mar 30 '10 at 10:39
  • I converted them to the WMV format. I did change the reference from ladieda.com to the real files.. – Michel Mar 30 '10 at 18:39
  • At my (IE8) screen the movies show up as 1 black mediaplayer and 4 white ones, is that the same at your computer? – Michel Mar 30 '10 at 18:40
  • I converted the MP4 files to WMV with the FlipCamera software, and also (for the 4th and 5th one) windows movie maker to create new WMV's (just in case the FlipCamera software creates some kind of 'buggy' WMV's) – Michel Mar 30 '10 at 18:42
  • @Michel, this is the cause why your mediaplayer starts as white. ``. Do you want the movie to play? By clicking the path directly to the video file, it seems that the file isn't in the server as you think it is. – Buhake Sindi Mar 30 '10 at 21:13
  • @TEG, No, i don't want the video's te play right away, because i want to place a series on the page, and in that case they will all start at the same time. The movies are on the server, because when i click 'play' the video plays (did you check the uri? http://www.verfrisser.net/tst/test2.html) But for instance the first one show black in stead of a preview of the movie, does it show a black rectangle at the first one too? – Michel Mar 31 '10 at 19:31
  • @Michel, If you never specify auto-play, the player will never do anything because nothing is buffered. Buffering starts on play. The cause of why the display was white, I've already mentioned it. The first player doesn't have the `transparentatStart` attribute. – Buhake Sindi Apr 01 '10 at 09:33
  • Ok, maybe i'm not being clear enough on this. I'll try to explain a bit clearer: If you go to this page (http://www.photofacts.nl/fotografie/rubriek/video_tutorials/tutorial_zwart-wit_omzetting_via_kleurtoonverzadiging.asp) you see a embedded video (it is not a WMV by the way). For this video you don't see a blank or transparent or black window, but the first frame of the video. That is what i want to achieve: show the first frame in stead of the blank or transparent or black window. PS Thanks for your effort so far! – Michel Apr 01 '10 at 11:16
  • From the example you gave me, you cannot use WMPlayer for it (unless it's possible, but I'm not certain of as yet). What Youtube does is it creates an image of the videos uploaded (by retrieving random frame from video) and displays it as 1st frame. The video isn't buffered until you click play. E.g. youtube video image buffer (http://i.ytimg.com/vi/h6DmEgtibOg/2.jpg) – Buhake Sindi Apr 01 '10 at 12:57
  • aha, maybe i'll do that too, just read a frame to create a preview image. Thanks for your replies! – Michel Apr 01 '10 at 13:17
  • It doesn't work in FF3.6 for me, only in IE(8). Any idea why? In FF, the space for the video remains black. – Mathias Conradt Sep 08 '10 at 08:47
  • @The Elite Gentleman yes, I had some problems with your sample. But I figured out that it only works in FF if the video URL is absolute, not relative. – Mathias Conradt Sep 08 '10 at 09:10
  • One problem with FF is still there though: the movie won't scale if it the width/height params are smaller than the actual movie size. – Mathias Conradt Sep 08 '10 at 09:16
  • ...even with stretchToFit='1' param set – Mathias Conradt Sep 08 '10 at 09:25
  • try `stretchToFit="true"`. Look @ (http://www.gravlab.com/forum/2007/09/06/how-to-embed-windows-media-player-into-an-html-document/) – Buhake Sindi Sep 08 '10 at 09:53
-9
<param name="fileName" value="http://www.ladieda.com/mymovie.wmv">  is good for ff

for IE should use name="URL"

too lazy to provide link to msdn.