|<embed> vs <object>|
what is the difference?
| 10:30 pm on Jan 3, 2008 (gmt 0)|
I'm trying to embed a mediaplayer and from what I have learned <object> is the newest and preferd! The thing is, I can't get <object> to work on all browsers...at least <embed> works in firefox.
So what is the difference?
Which one should I use and why?
also, has the choice anything to do with what version of the mediaplayer the user has? or is it just the id you give it?
| 11:15 pm on Jan 3, 2008 (gmt 0)|
Welcome to WebmasterWorld.
In the past it was normal procedure to use both OBJECT and EMBED tags in your HTML, but in 2006 changes to Internet Explorer due to the EOLAS case effectively made this approach obselete.
| 11:55 pm on Jan 3, 2008 (gmt 0)|
<Object> embeds the active-x component for IE; <embed> is for NS, FF. When using the object, for the older players (up to 8 if remember well) you specify the version in the codebase parameter, for the latest 10, 11 classid does the job. Classid in the embed specifies the version too.
If you embed the older player you will still be able to playback files for users with newer players.
Otherwise you might want to take a look at the SilverLight plug-in -- player and browser independent playback for windows media files.
| 6:26 am on Jan 4, 2008 (gmt 0)|
| 7:37 am on Jan 4, 2008 (gmt 0)|
Thanks very much for the answers!
Also where I can find info about silverlight...
I don't think I need to be able to play any formats but I want to be able to play up hd-formats and stream large media files!
| 1:05 am on Jan 5, 2008 (gmt 0)|
There's really no good answer for this, because no matter which way you turn there is browser compatibility issues for embedding a player. Even if you could get by that you still have video compatibility issues, just because it plays on your machine doesn't necessarily mean it can play on someone else's. Divx for example is great video codec for highly compressed material but you'll be excluding a lot of peopla that do not have the codec installed. The only thing close to a universal video format is MPEG1, downside is that it requires 4X to 5X the bitrate that other compressed formats like Divx and WMV for comparble quality which increases the file size 4X to 5X.
The next in the list for compatible video formats would be WMV but that precludes most people not using a Windows machine.
I've always used WMV myself in the past but with the popularity of Youtube flash is definitely looking like a viable alternative.
| 11:07 pm on Jan 5, 2008 (gmt 0)|
<<<...hd-formats and stream large media files>>>
Large files means either short uncompressed or close to uncompressed videos; or long videos.
- If you have short videos, 1-5 mins, just post them in any format (Windows, MPEG1, QT) for download.
- If they are long videos you might want to consider putting them on a streaming (windows media is still the optimal choice as per cost effectiveness) server -- users will be able to FF or jump at any point of the video without having to download it.
Look for silverlight on the MS site, there's plenty of info and examples, major league baseball f.i.
| 1:06 pm on Jan 6, 2008 (gmt 0)|
"- If they are long videos you might want to consider putting them on a streaming (windows media is still the optimal choice as per cost effectiveness) server -- users will be able to FF or jump at any point of the video without having to download it."
This is what I want... So what should I use to get good result for this kind of streaming? Windows media player, silverlight or some other choice? also, how do I set up a streaming server, is that a part of windows server 2003 or is it a part of vista or do I need separate software for this?
also, is it easy to link "windows media player"/silverlight from your website to your streamingserver?
| 9:46 pm on Jan 9, 2008 (gmt 0)|
Windows Media Server (services) is part of the server 2003. Install the services and then you'll configure a publishing publishing point by using the management console. Then just assign the content to it and link to the content. Yes, the basics are that simple.
You'll stream windows media files, which can be viewed with windows media player (stand-alone or embedded) or embedded through the silverlight plug in.
There's plenty of info on the MS site about creating files, configuring the server, and delivering the media. You might look also into the SDK for developing custom solutions.
| 12:12 pm on Feb 7, 2008 (gmt 0)|
In response to Samizdata:
I've heard about this issue before, but I still use the the object/embed combination (with windows media player), and it seems to work fine with the latest versions of explorer, firefox & opera on WinXP sp2.
I include a link to download the latest firefox wm plugin:
<a href="http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx">Windows Media Player Plugin for Firefox on Windows.</a>
It even works for the Mac's I've tried, but not as an embedded player; the mac launches a stand-alone player.
Is there something I'm missing?
The code I use is:
<object id="MediaPlayer1" width=320 height=240
standby="Loading Microsoft® Windows® Media Player components..."
<param name="FileName" value="http://www.example.com/sample-MVI_3664-148kbs.wmv">
<param name="AutoStart" value="1">
<param name="ShowStatusBar" value="True">
<param name="DefaultFrame" value="mainFrame">
<PARAM NAME="showControls" VALUE="true">
pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
[edited by: engine at 2:16 pm (utc) on Feb. 7, 2008]
[edit reason] examplified [/edit]
| 1:45 pm on Feb 7, 2008 (gmt 0)|
|Is there something I'm missing? |
A little history:
In April 2006 Microsoft changed Internet Explorer so that OBJECT, EMBED and APPLET tags would bring up an annoying "Click to activate and use this control" message for anything interactive. The change was made in a "Security Update", though security was never the issue.
It was in fact due to Microsoft losing a long running legal case over a patent owned by EOLAS Technologies - I won't go into details, but the patent was certainly controversial and could have been used against all other browser manufacturers (though only IE6 upwards was affected at the time).
It had a massive effect on any webmaster who (like me) used a lot of interactive rich media on their sites - two years ago I had to rewrite the markup for all my Flash, QuickTime, ShockWave, Java and RealPlayer files (well over a thousand altogether), and both of my Windows Media files.
So it was a lot of (unpaid) work for webmasters, and all the software applications that spewed out OBJECT and EMBED tags (such as Flash and Dreamweaver) had to issue fixes too, but it took time.
Microsoft recently settled the patent case for an undisclosed sum (which was probably not the $521,000,000 awarded by the jury in 2003). According to the official IE blog the browser will be changed again in April 2008 to revert to the previous situation, so anyone who is new to this stuff probably has nothing to worry about.
|It even works for the Mac's I've tried, but not as an embedded player; the mac launches a stand-alone player. |
That is a different issue - Windows Media Player for Mac was discontinued long ago, few Mac users will have it installed these days, and most will not know of the alternative plugins available. The fact that a stand-alone player was launched in your tests should have warned you to try a different approach.
The web is cross-platform or it is nothing, and I would advise using almost anything except WMV (which didn't even work on some flavours of Vista last time I looked).
You may wish to edit out the URLs you posted, which are discouraged here.
| 2:22 pm on Feb 7, 2008 (gmt 0)|
Thanks for your response. At your suggestion, I tried to edit the post to remove the URL's, but apparently too much time had passed. I hope it was clear I wasn't trying to promote any commercial interest, just copy & paste some code to illustrate what I was doing.
I still observe that the video plays fine in Explorer, firefox & opera without having to click on the player to play. Maybe because auto-play is set to true? Anyway, good news that issue will be resolved in April.
| 8:43 pm on Feb 7, 2008 (gmt 0)|
The video will play, the user can't use the controls on the player until they "click to activate".
| 8:45 am on Feb 25, 2008 (gmt 0)|
What is the ultimate advice, then? Simply include a link to the flv or mp3 and let whatever player pop up? No object tag, no embed, no nothing? What if the system disallows popup windows?