Object ID embed and validation??

  • Thread starter Christopher Richards
  • Start date
R

Roy Schestowitz

Christopher said:
Is it possible to correctly validate an xhtml page with the object ID and
embed necessary to implant a windows media player in an html page?
Here is the code suggested by http://www.streamalot.com/embed.shtml. This
validator http://validator.w3.org/file-upload.html doesn't like it at all.

================================================================
<!-- BEGIN GENERIC ALL BROWSER FRIENDLY HTML FOR WINDOWS MEDIA PLAYER -->

<object id="MediaPlayer1" width=180 height=200
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" align="middle">
<param name="FileName" value="Server/file">
<param name="ShowStatusBar" value="True">
<param name="DefaultFrame" value="mainFrame">
<embed type="application/x-mplayer2"
pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
src="Server/File" align="middle"
width=176
height=144
defaultframe="rightFrame"
showstatusbar=true>
</embed>
</object> <!-- END GENERIC ALL BROWSER FRIENDLY HTML FOR WINDOWS MEDIA
PLAYER --><br>
<a href="Server/file"><font size="2">Click
here for standalone player</font></a><br>

<a
href="http://www.microsoft.com/windows/windowsmedia/en/default.asp"><font
size="1">Download Windows Media Player Here</font></a></p>
================================================================

Without trying the validation, I can already spot some tags that do not
close, e.g. replace <br> with <br />.

The code above was probably intended for HTML, not XHTML.

Roy
 
J

Jim Roberts

Is it possible to correctly validate an xhtml page with the object ID
and embed necessary to implant a windows media player in an html page?
Here is the code suggested by http://www.streamalot.com/embed.shtml.
This validator http://validator.w3.org/file-upload.html doesn't like
it at all.

Some of the attributes, such as "align" and "pluginspage" aren't valid
attributes. About the best I could do using xhtml is the following:

<p><object id="mediaplayer1" width="180" height="200"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2
inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" >
<param name="FileName" value="Server/file" />
<param name="ShowStatusBar" value="true" />
<param name="DefaultFrame" value="mainFrame" />
<!-- For other browsers * Windows Media Player -->
<!--[if !IE]> <-->
<object width="180" height="200" type="application/x-mplayer2">
<param name="FileName" value="Server/file" />
<param name="ShowStatusBar" value="true" />
<param name="DefaultFrame" value="mainFrame" />
</object>
<!--> <![endif]-->
</object></p>

It works for IE and Gecko based browsers and does validate as xhtml
strict. Not sure about others, but I don't think Opera supports the
object element. There's probably a better method. You
might consider using an html doctype.
 
T

Toby Inkster

Christopher said:
Is it possible to correctly validate an xhtml page with the object ID and
embed necessary to implant a windows media player in an html page?

What's wrong with:

<object data="myfilm.avi" height="120" width="180" type="video/x-msvideo">
<p>Your browser doesn't appear to support emebedded AVI video files, so
please download <a href="myfilm.avi">my film</a> and view it in your
favourite media player.</p>
<p>Here is a still image from the film to whet your appetite:<br/>
<img src="mystill.png" style="height:120px;width:180px"/></p>
</object>

???
 
L

Leif K-Brooks

Toby said:
What's wrong with:

<object data="myfilm.avi" height="120" width="180" type="video/x-msvideo">
<p>Your browser doesn't appear to support emebedded AVI video files, so
please download <a href="myfilm.avi">my film</a> and view it in your
favourite media player.</p>
<p>Here is a still image from the film to whet your appetite:<br/>
<img src="mystill.png" style="height:120px;width:180px"/></p>
</object>

Missing alt attribute? Using CSS for specifying an image's height and
width instead of the HTML height and width attributes?
 
C

Christopher Richards

Toby Inkster said:
What's wrong with:

<object data="myfilm.avi" height="120" width="180" type="video/x-msvideo">
<p>Your browser doesn't appear to support emebedded AVI video files, so
please download <a href="myfilm.avi">my film</a> and view it in your
favourite media player.</p>
<p>Here is a still image from the film to whet your appetite:<br/>
<img src="mystill.png" style="height:120px;width:180px"/></p>
</object>
Thanks for the response Toby. First, I wouldn't try streaming an AVI or
downloading video. AVI is just no good for the web. It is great format for
editing but not final web output. I wouldn't want the user to take any
action apart from clicking and viewing. The other problem, as I see it, that
Mozilla/Netscape needs that embed tag.
 
S

Steve Pugh

Christopher Richards said:
Thanks for the response Toby. First, I wouldn't try streaming an AVI or
downloading video. AVI is just no good for the web. It is great format for
editing but not final web output. I wouldn't want the user to take any
action apart from clicking and viewing.

Then use another format, the above technique will work with other
formats.
The other problem, as I see it, that
Mozilla/Netscape needs that embed tag.

Netscape 4 does, but Mozilla/Netscape 6+ certainly do not. You
probably once tried the MS mangled version of <object> rather than the
standards compliant version used above.

Steve
 
T

Toby Inkster

Leif said:
Missing alt attribute?
Correct.

Using CSS for specifying an image's height and width instead of the
HTML height and width attributes?

Presentational crap best handled by CSS.
 
S

Spartanicus

First, I wouldn't try streaming an AVI or
downloading video. AVI is just no good for the web. It is great format for
editing but not final web output.

AVI is a "wrapper" format, as such it can contain any known compression
format. You may be thinking of uncompressed AVI.
 
L

Leif K-Brooks

Toby said:
Presentational crap best handled by CSS.

Unless you're trying to resize the image with HTML -- and that's a bad
idea anyway -- the width and height attributes aren't presentational.
They're specifying intrinsic data about the image's content, just like
the src attribute does.
 
C

Christopher Richards

Jim Roberts said:
Is it possible to correctly validate an xhtml page with the object ID
and embed necessary to implant a windows media player in an html page?
Here is the code suggested by http://www.streamalot.com/embed.shtml.
This validator http://validator.w3.org/file-upload.html doesn't like
it at all.

Some of the attributes, such as "align" and "pluginspage" aren't valid
attributes. About the best I could do using xhtml is the following:

<p><object id="mediaplayer1" width="180" height="200"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2
inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" >
<param name="FileName" value="Server/file" />
<param name="ShowStatusBar" value="true" />
<param name="DefaultFrame" value="mainFrame" />
<!-- For other browsers * Windows Media Player -->
<!--[if !IE]> <-->
<object width="180" height="200" type="application/x-mplayer2">
<param name="FileName" value="Server/file" />
<param name="ShowStatusBar" value="true" />
<param name="DefaultFrame" value="mainFrame" />
</object>
<!--> <![endif]-->
</object></p>

It works for IE and Gecko based browsers and does validate as xhtml
strict. Not sure about others, but I don't think Opera supports the
object element. There's probably a better method. You
might consider using an html doctype.
Jim, I'd like to follow up on your suggestion of using an html doctype. Do
you have a link to where I can read more?
 
J

Jim Roberts

Jim, I'd like to follow up on your suggestion of using an html
doctype. Do you have a link to where I can read more?

It seems I misspoke. Apparently, the embed element is not valid with any
document type.
Note: The <embed> element is supported by both Internet Explorer and
Netscape, but it is not a standard HTML or XHTML element.
The World Wide Web Consortium (W3C) recommend using the <object>
element instead.
http://www.w3schools.com/media/media_browservideos.asp

If you want your code to validate, you won't be able to use <embed>.
 
L

Leif K-Brooks

Toby said:
Leif K-Brooks wrote:

[The width and height attributes of an image] specifying intrinsic
data about the image's content, just like the src attribute does.

What about with vector graphics?

It's a tough question, but I would lean towards calling size
specifications content even with vector. Most vector formats specify a
default size, just like raster graphics do; the HTML document is just
saying that "the vector graphic I'm referring to here has size X and
height Y; I'm simply duplicating that same information here for
efficiency's sake." It's kind of similar to how <a href="sample.css">a
stylesheet that makes things red</a> is content, even though it talks
about the presentation of another document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top