Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: Black borders after switching from to tag

HTVi
TV Discussion Newsgroups

Black borders after switching from <embed> to <object> tag
Stas 4/26/2007 10:28:00 AM
Hi.

I changed the method of including WMP in HTML from <embed> (which not fully
supported by IE) to <object> tag, as follows:

<object id="mplayer" width="320" height="200"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> \
<param name="URL" value="http://localhost/test.wmv"> \
<param name="uiMode" value="none"> \
<param name="StretchToFit" value="true"> \
</object>';

When I did this, I noticed black borders that appeared around the video,
like the ratio is being preserved. I don't require this, and with embed it
worked just fine.

Any idea if it can be correct?

Also, the "StretchToFit" option for some reason doesn't has any effect at all.

Thanks,
Stas.
Re: Black borders after switching from <embed> to <object> tag
"Neil Smith [MVP Digital Media]" <neil[ at ]nospam.com> 4/26/2007 9:03:41 PM
Isolate the problem by placing the player control in an empty HTML
page, that is between the <body /> tags, and make sure there are no
CSS or other HTML elements around it. Now does that change ?

I'd also correct your embedding code which is defective.

In XHTML, the closing element for non-paired tags has the backslash
(not forward slash as used here) inside the right angle bracket -
you've created CDATA (character data) inside your object by doing

<param name="uiMode" value="none"> \

which should read (4 instances, including object tag)

<param name="uiMode" value="none" />

In addition, you've followed the closing </object> tag with something
that looks like a cut+paste accident from a javascript document.write
function. Remove that too.

Cheers - Neil


On Thu, 26 Apr 2007 03:28:00 -0700, Stas
<Stas[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>Hi.
>
>I changed the method of including WMP in HTML from <embed> (which not fully
>supported by IE) to <object> tag, as follows:
>
><object id="mplayer" width="320" height="200"
>classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> \
> <param name="URL" value="http://localhost/test.wmv"> \
> <param name="uiMode" value="none"> \
> <param name="StretchToFit" value="true"> \
> </object>';
>
>When I did this, I noticed black borders that appeared around the video,
>like the ratio is being preserved. I don't require this, and with embed it
>worked just fine.
>
>Any idea if it can be correct?
>
>Also, the "StretchToFit" option for some reason doesn't has any effect at all.
>
>Thanks,
>Stas.
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Re: Black borders after switching from <embed> to <object> tag
"Neil Smith [MVP Digital Media]" <neil[ at ]nospam.com> 4/28/2007 3:38:46 PM
On Thu, 26 Apr 2007 21:03:41 GMT, "Neil Smith [MVP Digital Media]"
<neil[ at ]nospam.com> wrote:


[Quoted Text]
>In XHTML, the closing element for non-paired tags has the backslash
>(not forward slash as used here)

If course, I meant to write that the other way round (XHTML uses
forward slashes, not the backslashes as used in your code example)

Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Re: Black borders after switching from <embed> to <object> tag
Stas 4/29/2007 11:54:00 AM
Hi.

Thanks for the hints, but the borders are still present.

Let me clarify the problem:

The video control itself is displayed just fine in the defined area. The
problem is that the actual video frames (displayed in the video control) are
now narrower, which causes the black borders. It didn't happen when the
control was embedded via the <embed> tag.

So this is not HTML-related but has to do with the control. I read in the
WMP SDK API that StretchToFit = true, should solve this, but enabling it
doesn't make any visible difference.

Regards,
Stas.

"Neil Smith [MVP Digital Media]" wrote:

[Quoted Text]
> On Thu, 26 Apr 2007 21:03:41 GMT, "Neil Smith [MVP Digital Media]"
> <neil[ at ]nospam.com> wrote:
>
>
> >In XHTML, the closing element for non-paired tags has the backslash
> >(not forward slash as used here)
>
> If course, I meant to write that the other way round (XHTML uses
> forward slashes, not the backslashes as used in your code example)
>
> Cheers - Neil
> ------------------------------------------------
> Digital Media MVP : 2004-2007
> http://mvp.support.microsoft.com/mvpfaqs
>
Re: Black borders after switching from <embed> to <object> tag
Stas 4/29/2007 1:02:00 PM
An additional update:

The borders issue only happens when the
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" tag is added to
embedding code.

Apparently this enables the latest player, as without it the Player.controls
object is undefined. The parameters are changed as well - the "URL" becomes
"src", "uiMode = none", works only as "showControls=none" and similar.

Any what actually happens here? I mean, is the older version is actually
used when the above classid not specified, which doesn't have borders but
also doesn't provide the controls object?

Thanks,
Stas.

"Stas" wrote:

[Quoted Text]
> Hi.
>
> Thanks for the hints, but the borders are still present.
>
> Let me clarify the problem:
>
> The video control itself is displayed just fine in the defined area. The
> problem is that the actual video frames (displayed in the video control) are
> now narrower, which causes the black borders. It didn't happen when the
> control was embedded via the <embed> tag.
>
> So this is not HTML-related but has to do with the control. I read in the
> WMP SDK API that StretchToFit = true, should solve this, but enabling it
> doesn't make any visible difference.
>
> Regards,
> Stas.
>
> "Neil Smith [MVP Digital Media]" wrote:
>
> > On Thu, 26 Apr 2007 21:03:41 GMT, "Neil Smith [MVP Digital Media]"
> > <neil[ at ]nospam.com> wrote:
> >
> >
> > >In XHTML, the closing element for non-paired tags has the backslash
> > >(not forward slash as used here)
> >
> > If course, I meant to write that the other way round (XHTML uses
> > forward slashes, not the backslashes as used in your code example)
> >
> > Cheers - Neil
> > ------------------------------------------------
> > Digital Media MVP : 2004-2007
> > http://mvp.support.microsoft.com/mvpfaqs
> >
Re: Black borders after switching from <embed> to <object> tag
"Neil Smith [MVP Digital Media]" <neil[ at ]nospam.com> 5/1/2007 8:57:19 PM
There's probably a little disconnect with the SDK documentation, it's
not always written completely clearly (however this effect *is*
documented : "If the aspect ratio of the video does not match the
aspect ratio of the video window, black mask areas may appear")

When you specify <param name="stretchtofit" value="true" /> media
player makes a best-fit estimation for the video and fills the display
area as completely as possible, while maintaining aspect ratio.

So either the X or Y direction will be scaled to meet the edges.

However only the coincidence that your box *happens* to have the same
aspect ratio as your source video will it go completely to the edges
on both dimensions.

Similar letterboxing happens on standard def TVs when playing
widescreen content back from


[Quoted Text]
>The borders issue only happens when the
>classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" tag is added to
>embedding code.


Because before you introduce that you may (or may not, it's a lottery)
be using the media player 6.4 control. By specifying the CLSID above
to IE, you have chosen a specific object model for playback.

The player 6.4 model is about 8 or 9 years old, and not surprisingly
due to be retired by now. WMP64 had distinctly different behaviours,
which like resizing by stretching aspect ratios, is generally not what
most people want (tall, thin, or wide, fat people look pretty odd)

It was retained for backward compatibility for an amazingly long time,
but people are still embedding with code from 1998 as if it's current.
Best move on ;-)


>Apparently this enables the latest player, as without it the Player.controls

In fact, media player 7 and later (from ~2000 or so) !


>object is undefined. The parameters are changed as well - the "URL" becomes
>"src", "uiMode = none", works only as "showControls=none" and similar.
>
>Any what actually happens here? I mean, is the older version is actually
>used when the above classid not specified, which doesn't have borders but
>also doesn't provide the controls object?


Sometimes it's used by mistake in Netscape / Firefox, depending on the
particular order WMP is added to the system, and which plugin FF picks
up, using a registry shim. In general, it's been a bit of a mess.


HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Re: Black borders after switching from <embed> to <object> tag
Stas 5/10/2007 5:04:02 PM
Hi Neil.

Thanks for the detailed and through answer.

So to summarize, WMP versions before 7 didn't actually preserved the aspect
ratio, causing distortion to video. WMP 7 and on preserves the aspect ratio,
but this may cause either horizontal or vertical borders.


Now, I actually was able to enjoy to both worlds. After some fiddling I
found the required functions to be available directly in the Player object.
Meaning, I'm able to call Player.play(), Player.stop(), etc...

As you described, it means that I'm actually using the old, 6.4 media object
that doesn't preserves aspect ratio, and should be discarded. But when I
right click on the video and select "About", I see the 11 version. So does it
mean new WMP versions compatible with the old object control models?

Thanks again,
Stas.

"Neil Smith [MVP Digital Media]" wrote:

[Quoted Text]
> There's probably a little disconnect with the SDK documentation, it's
> not always written completely clearly (however this effect *is*
> documented : "If the aspect ratio of the video does not match the
> aspect ratio of the video window, black mask areas may appear")
>
> When you specify <param name="stretchtofit" value="true" /> media
> player makes a best-fit estimation for the video and fills the display
> area as completely as possible, while maintaining aspect ratio.
>
> So either the X or Y direction will be scaled to meet the edges.
>
> However only the coincidence that your box *happens* to have the same
> aspect ratio as your source video will it go completely to the edges
> on both dimensions.
>
> Similar letterboxing happens on standard def TVs when playing
> widescreen content back from
>
>
> >The borders issue only happens when the
> >classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" tag is added to
> >embedding code.
>
>
> Because before you introduce that you may (or may not, it's a lottery)
> be using the media player 6.4 control. By specifying the CLSID above
> to IE, you have chosen a specific object model for playback.
>
> The player 6.4 model is about 8 or 9 years old, and not surprisingly
> due to be retired by now. WMP64 had distinctly different behaviours,
> which like resizing by stretching aspect ratios, is generally not what
> most people want (tall, thin, or wide, fat people look pretty odd)
>
> It was retained for backward compatibility for an amazingly long time,
> but people are still embedding with code from 1998 as if it's current.
> Best move on ;-)
>
>
> >Apparently this enables the latest player, as without it the Player.controls
>
> In fact, media player 7 and later (from ~2000 or so) !
>
>
> >object is undefined. The parameters are changed as well - the "URL" becomes
> >"src", "uiMode = none", works only as "showControls=none" and similar.
> >
> >Any what actually happens here? I mean, is the older version is actually
> >used when the above classid not specified, which doesn't have borders but
> >also doesn't provide the controls object?
>
>
> Sometimes it's used by mistake in Netscape / Firefox, depending on the
> particular order WMP is added to the system, and which plugin FF picks
> up, using a registry shim. In general, it's been a bit of a mess.
>
>
> HTH
> Cheers - Neil
> ------------------------------------------------
> Digital Media MVP : 2004-2007
> http://mvp.support.microsoft.com/mvpfaqs
>
Re: Black borders after switching from <embed> to <object> tag
"Neil Smith [MVP Digital Media]" <neil[ at ]nospam.com> 5/10/2007 5:36:59 PM
On Thu, 10 May 2007 10:04:02 -0700, Stas
<Stas[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>Hi Neil.
>So to summarize, WMP versions before 7 didn't actually preserved the aspect
>ratio, causing distortion to video. WMP 7 and on preserves the aspect ratio,
>but this may cause either horizontal or vertical borders.

I believe that to be the case, yes.

>As you described, it means that I'm actually using the old, 6.4 media object
>that doesn't preserves aspect ratio, and should be discarded. But when I
>right click on the video and select "About", I see the 11 version. So does it
>mean new WMP versions compatible with the old object control models?

It uses a "shim" to maintain compatibility.
I think I'm repeating myself, but anyway :

>> It was retained for backward compatibility for an amazingly long time,

Depracated means "do not use for future proof applications" since your
application may simply cease to function in future versions of media
player.

I'm actually fairly surprised they maintained the object model
compatibility at all in WMP11, but then there's this silverlight thing
now, so all bets are off ;-)

Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Re: Black borders after switching from <embed> to <object> tag
Stas 5/11/2007 5:40:03 PM
Neil, thanks again for all the clarifications.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen