控件(播放暂停按钮)不会显示在视频中。

时间:2011-10-11 11:01:14

标签: mediaelement.js

我的代码如下。

Html部分

    <div id="div_video">
        <div class="div_vol">
        <a href="#" onclick="sound_adjustment()"><img id="sound_img" src="<?=bloginfo( 'template_url' )?>/images/muted.png"></a>
        </div>                              
        <img style="margin-left: 100px; margin-top: 40px" id="loading_vidio" src="<?php bloginfo( 'template_url' )?>/images/video_loading.gif"/>
            <video height="341" width="620" poster="<?php bloginfo( 'template_url' )?>/images/video.png" id="banner_advideo">
            <source type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' src="<?php bloginfo( 'template_url' )?>/video/<?php echo $videoname?>" />
            </video>
            <div class="videoPunch"><h2>Making froth at a touch of a button couldn't be easier.</h2></div>
        </div>

Javascript部分

     var me=new MediaElement('banner_advideo', {
         // shows debug errors on screen
         enablePluginDebug: false,
         // remove or reorder to change plugin priority
         plugins: ['flash'],
         // specify to force MediaElement to use a particular video or audio type

         features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],                    
         success: function (mediaElement, domObject) {

             // call the play method
             $('#loading_vidio').show();                     
             $('#div_video').show();                                     
             mediaElement.addEventListener('loadeddata', function(e) {                         
                $('#loading_vidio').hide();                            
               }, false);                    
             mediaElement.play();    
             mediaElement.setMuted(true);
         },
         // fires when a problem is detected
         error: function () {                  
         }
     });       

现在我的视频中没有显示控件(播放暂停按钮)。我读了2个类似的问题和答案,但我没有得到解决方案。

有人可以告诉我这可能是什么问题吗?

1 个答案:

答案 0 :(得分:0)

控件是MediaElementPlayer对象的属性。所以我做了它的对象,所以它现在以适当的方式显示所有控件。

相关问题