为什么videojs不会在IE6 / 7/8中播放我的Flash视频?

时间:2012-05-31 14:35:40

标签: flash internet-explorer-8 html5-video

我已将.mp4视频转换为ogg / webm / flv格式(使用ffmpeg)并使用videojs创建以下网页:

http://tanguay.info/examples/testvideo

在IE9,Chrome,Safari,Opera和Firefox中都可以正常播放。

然而,在 IE6,IE7和IE8 中,它应该“回归闪存”,但不显示任何视频应该在哪里(在IETester中测试):

enter image description here

如何在IE6 / IE7 / IE8中播放此页面?


的.htaccess

AddType audio/ogg oga ogg
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv

的index.htm

<!DOCTYPE html> 
<html>
    <head>
        <link href="videojs/video-js.css" rel="stylesheet">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>


    <script type="text/javascript">
        $(init);

        function init() {
            $('button#buttonSmallSize').click(function() {
                //$('video#my_video_1').css('width','512px');
                //$('video#my_video_1').css('height','288px');
                $('div#message').html('small size not yet implemented');
            });

            $('button#buttonLargeSize').click(function() {
                //$('video#my_video_1').css('width','768px');
                //$('video#my_video_1').css('height','432px');
                $('div#message').html('large size not yet implemented');
            });

        }

    </script>
    <style type="text/css">
        div#buttonRow {
            margin: 0 0 12px 0;
        }
        .theButton {
            float: left;
            margin: 0 5px 0 0;
            cursor: hand;
            cursor: pointer;
        }   
        .theMessage {
            float: left;
            margin: 0 5px 0 0;
            font-family: arial;
            color:#fff;
            font-size: 14pt;
        }   

    </style>

    </head>
<body style="background-color: #888">
    <div id="videobox" style="border-radius: 5px; width: 513px; padding: 10px; border: 1px solid #fff;background-image:url('images/chrome.jpg');;box-shadow: 10px 10px 5px #555">

    <div id="buttonRow">
    <button id="buttonSmallSize" class="theButton">Small Size</button>
    <button id="buttonLargeSize" class="theButton">Large Size</button>
    <div id="message" class="theMessage"></div>
    <div style="clear:both"></div>
    </div>
    <video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="512" height="288" data-setup="{}">
      <source src="videos/damconnect.mp4" type='video/mp4'>
      <source src="videos/damconnect.webm" type='video/webm'>
      <source src="videos/damconnect.ogg" type='video/ogg'>
      <source src="videos/damconnect.flv" type='video/x-flv'>
    </video>

    </div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

使用videojs,您不会像这样调用Flash视频。它会创建一个swf,在那里嵌入视频,只需转到http://videojs.com/docs/setup/并按照指南进行操作。