【问题标题】:mediaelement.js video doesn't play in IE8mediaelement.js 视频无法在 IE8 中播放
【发布时间】:2012-08-23 20:32:35
【问题描述】:

我已经查看了这里提出的所有其他问题,但没有什么能真正解决我的问题。

目前视频将在 Chrome、Safari、FF 和 IE9 中加载和播放,但不是 IE8,这是我需要支持的最后一个浏览器。您可以查看页面here

我一直在尝试使用调试选项,但也没有从中获得任何帮助。这是调试器告诉我的:

Initializing...
stage: 0x560
file: path/to/video.mp4
autoplay:true
preload:true
isvideo:true
smoothing:false
timerrate:250
displayState:true
ExternalInterface.available:true
ExternalInterface.objectID: me_flash_0
Adding callbacks...
Success...
METADATA RECEIVED:900x560
positioning video
seek:0
play

这是我的代码:

<video id="player1" width="900" height="560" loop="true" autoplay="true" preload="none" >
  <source type="video/mp4" src="<?php echo get_template_directory_uri(); ?>/images/curtainLoop.mp4" />
  <source type="video/webm" src="<?php echo get_template_directory_uri(); ?>/images/curtainLoop.webm" />
    <object width="900" height="560" type="application/x-shockwave-flash" data="<?php echo get_template_directory_uri(); ?>/js/flashmediaelement.swf"> 
        <param name="movie" value="<?php echo get_template_directory_uri(); ?>/js/flashmediaelement.swf" /> 
        <param name="flashvars" value="autoplay=true&amp;controls=true&amp;file=<?php echo get_template_directory_uri(); ?>/images/echo-hereweare.mp4" />                       
    </object></video>

<span id="player1-mode"></span>
 <script>
    jQuery(document).ready(function($) {
    var player = new MediaElementPlayer('#player1', {
        enablePluginDebug: true,
        enableAutosize: true,
        success: function(media, node, player) {  
            $('#' + node.id + '-mode').html('mode: ' + player.pluginType);  
        }  
        });
    });
</script>

在 MediaElement 网站之后,我添加了跨度以输出模式,该模式返回为“未定义”而不是“本机”或“闪存”。不确定这是否是问题所在,但此时我只是不知道去哪里找。

非常感谢任何帮助。

【问题讨论】:

    标签: javascript jquery html internet-explorer-8 mediaelement.js


    【解决方案1】:

    我以前也遇到过这个问题,但花了一段时间才知道是什么原因造成的。我已经对此进行了测试,它似乎也适用于您的情况:

    在 MediaElement 创建的 .me-plugin div 上,CSS 中有一个 position: absolute; 引用。当我将其设置为position:static; 时,IE8 中一切正常。

    我通常会这样做:

    .ie8 .me-plugin { position: static; }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-26
      • 1970-01-01
      相关资源
      最近更新 更多