tags:

views:

893

answers:

1

Hi,

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"&gt; 
<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.

+1  A: 

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"&gt;
      <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"&gt; 
<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).

The Elite Gentleman
Hi, i've uploaded a live sample, but still a black rectangle here:http://www.verfrisser.net/tst/test2.html
Michel
They do give a preview image in windows explorer.
Michel
they are movies from a Flip video camera, which are natively MP4
Michel
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)
The Elite Gentleman
Windows Media Player cannot play MP4 format if I'm not mistaken.
The Elite Gentleman
I converted them to the WMV format. I did change the reference from ladieda.com to the real files..
Michel
At my (IE8) screen the movies show up as 1 black mediaplayer and 4 white ones, is that the same at your computer?
Michel
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
@Michel, this is the cause why your mediaplayer starts as white.`<param name='transparentatStart' value='true'>`. 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.
The Elite Gentleman
@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
@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.
The Elite Gentleman
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
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)
The Elite Gentleman
aha, maybe i'll do that too, just read a frame to create a preview image. Thanks for your replies!
Michel
I'm glad that I could help.
The Elite Gentleman
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 Lin
@Mathias Lin, what doesn't work? My example?
The Elite Gentleman
@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 Lin
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 Lin
...even with stretchToFit='1' param set
Mathias Lin
try `stretchToFit="true"`. Look @ (http://www.gravlab.com/forum/2007/09/06/how-to-embed-windows-media-player-into-an-html-document/)
The Elite Gentleman