开发者

How to embed stream content that Windows Media Player supports in a web page that works in Mac OS?

开发者 https://www.devze.com 2022-12-22 09:05 出处:网络
I have HTML page where window开发者_运维百科s media player is embedded. It works very well in all browsers on Windows, but when trying to open in Firefox on Mac OS, it fails to open.

I have HTML page where window开发者_运维百科s media player is embedded. It works very well in all browsers on Windows, but when trying to open in Firefox on Mac OS, it fails to open.

Is there any alternative method which can be controlled using Javascript or HTML or do I have to install Window Media Player support for Mac OS?


Try streaming with flash as a fallback, or use the <video> or <audio> tag, that Safari supports.

If you are trying to stream video in a way that works consistently on every browser, you should look into Video For Everyone:

Video for Everybody is very simply a chunk of HTML code that embeds a video into a website using the HTML5 element which offers native playback in Firefox 3.5 and Safari 3 & 4 and an increasing number of other browsers.

The video is played by the browser itself. It loads quickly and doesn’t threaten to crash your browser.

In other browsers that do not support , it falls back to QuickTime.

If QuickTime is not installed, Adobe Flash is used. You can host locally or embed any Flash file, such as a YouTube video.

The only downside, is that you have to have 2/3 versions of the same video stored, but you can serve to every existing device/browser that supports video (i.e.: the iPhone).

<video width="640" height="360" poster="__POSTER__.jpg" controls="controls">
    <source src="__VIDEO__.ogv" type="video/ogg" />
    <source src="__VIDEO__.mp4" type="video/mp4" /><!--[if gt IE 6]>
    <object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!
    [endif]--><!--[if !IE]><!-->
    <object width="640" height="375" type="video/quicktime" data="__VIDEO__.mp4"><!--<![endif]-->
    <param name="src" value="__VIDEO__.mp4" />
    <param name="autoplay" value="false" />
    <param name="showlogo" value="false" />
    <object width="640" height="380" type="application/x-shockwave-flash"
        data="__FLASH__.swf?image=__POSTER__.jpg&amp;file=__VIDEO__.mp4">
        <param name="movie" value="__FLASH__.swf?image=__POSTER__.jpg&amp;file=__VIDEO__.mp4" />
        <img src="__POSTER__.jpg" width="640" height="360" />
        <p>
            <strong>No video playback capabilities detected.</strong>
            Why not try to download the file instead?<br />
            <a href="__VIDEO__.mp4">MPEG4 / H.264 “.mp4” (Windows / Mac)</a> |
            <a href="__VIDEO__.ogv">Ogg Theora &amp; Vorbis “.ogv” (Linux)</a>
        </p>
    </object><!--[if gt IE 6]><!-->
    </object><!--<![endif]-->
</video>

If you need to look for a Flash based player (both audio and video), take a look at Flowplayer, an Open Source (GPL 3) video player for the Web. It can do almost anything you might want to do, and there is an extensive collection of plugins for many applications.


Side-step the problem by using a flash based mp4 video player, this approach is the de facto one currently.

0

精彩评论

暂无评论...
验证码 换一张
取 消