0

我有一个带有 Flash 后备的 html5 播放器,如下所示:

<div class="divVideoWrapper">
<div class="divVideo">
<div class="divVideoContainer">
    <div id="videoPlayerChange"  class="video_player">
        <video class="scrPoster" controls="controls" poster="http://static.e-talemedia.net/content/images/testfirstframe.png" >
            <source id="scrVideomp4"  class="scrVideomp4" src="http://static.e-talemedia.net/content/video/bosch/testfeaturevideo.mp4" type="video/mp4" />
            <source id="scrVideowebm" class="scrVideowebm" src="http://static.e-talemedia.net/content/video/bosch/testfeaturevideo.webm" type="video/webm" />
            <source id="scrVideogg" class="scrVideogg" src="http://static.e-talemedia.net/content/video/bosch/testfeaturevideo.ogv" type="video/ogg" />
            <object id="objFlash" width="352" height="198">
                <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf">
                </param>
                <param name="allowFullScreen" value="true"></param>
                <param name="allowscriptaccess" value="always"></param>
                <embed src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="330" height="185" flashvars="src=http://static.e-talemedia.net/content/video/bosch/testfeaturevideo.mp4&poster=http://static.e-talemedia.net/content/images/testfirstframe.png"></embed>
            </object>
        </video>
    <div class="custom_controls">
        <div class="divBigButton">
        <a class="playBig" title="playBig"></a>
        </div>
        <a class="play" title="Play"></a><a class="pause" title="Pause"></a>
        <div class="volumeWrapper">
                <div class="volume">
                        <div class="volume_slider">
                        </div>
                <a class="mute" title="Mute"></a><a class="unmute" title="Unmute"></a>
                </div>
        </div>
        <div class="timer">
        00:00</div>
        <div class="time_slider">
        </div>
    </div>
</div>
<script>
    $(function () {
    $('.video_player').myPlayer();
    });
</script>

当用户点击某个功能时,会加载一个新视频,在 HTML5 中它将开始播放,但在 Flash 中则不会。我尝试在参数中添加 swf&autoStart=true" 并在嵌入部分中添加 autoplay ="yes" 和 autostart = "true" 但这些似乎不起作用 - 我正在 ie8 中对其进行测试,因为这是回退的浏览器闪烁。

改变视频的jQuery脚本

 <script type="text/javascript">
        //<![CDATA[
        $(document).ready(function () {

            $(document).on("click", ".featureLogoText", function () {


                var media = $(this).attr('media');
                var mediamp4 = media + "mp4";
                var mediawebm = media + "webm";
                var mediaogv = media + "ogv";
                var newPoster = $(this).attr('data-poster');

                var html = ' <param name=\"movie\" value=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\" type=\"application/x-shockwave-flash\"allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"330\" height=\"185\" autoplay =\"true\" flashvars=\"src=' + mediamp4 + '&poster=' + newPoster + '\"></embed>';

                $("#objFlash").html("");
                $("#objFlash").append(html);



                var displayText = $(this).text();

                $(".divBottomRight .nowPlaying").text("Now Playing: ");
                $(".divBottomRight .nowPlayFeature").text(displayText);

                var number = $(this).attr('data-number');


            });
        });
    //]]>
    </script>

非常感谢任何帮助!

谢谢

4

1 回答 1

0

找到答案 b 单击左侧的链接之一!

将 Flash 嵌入到自动播放中

所以基本上我用 &autoPlay=true 替换了我的 &poster = 嵌入在 flashvars 中

于 2013-06-04T10:41:51.263 回答