Mediaelement.js malfunction in IE, no flashback wo

2019-01-25 14:28发布

I used the mediaelement.js in my site, i used for the example a .mp4 file with H.264 codec, works well in all browsers, but not works in any version of Internet explorer when i publish the site, on my localhost don't have any problem (the flash fallback works well) , but in my server don't works.

The code the i used is:

<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>VIDEO HTML5</title>

    <script type="text/javascript" src="player_files/jquery.js"></script>
    <script type="text/javascript" src="player_files/mediaelement-and-player.min.js"></script>
    <link href="player_files/mediaelementplayer.min.css" rel="Stylesheet" />
</head>

<body>


<video id="video1" src="http://www.teletica.com/html5/videos/precious.mp4" width="640" height="360" poster="http://www.teletica.com/html5/videos/precious.jpg" controls="controls" preload="none"></video>

<video width="640" height="360" id="video2" poster="videos/precious.jpg" controls="controls" preload="none">
    <source type="video/mp4" src="http://teletica.com/html5/videos/precious.mp4" />
    <source type="video/webm" src="http://teletica.com/html5/videos/precious.webm" />

    <object width="640" height="360" type="application/x-shockwave-flash" data="player_files/flashmediaelement.swf">        
        <param name="movie" value="player_files/flashmediaelement.swf" /> 
        <param name="flashvars" value="controls=true&file=http://teletica.com/html5/videos/precious.mp4" />         

        <img src="player_files/precious.jpg" width="640" height="360" alt="Here we are" title="No video playback capabilities" />
    </object>   
</video>

<script type="text/javascript">
    $('video, audio').mediaelementplayer();
</script>

The player works in this direction "http://www.teletica.com/html5"

4条回答
虎瘦雄心在
2楼-- · 2019-01-25 14:36

Just putting it here so other people see it, I tried using this code

/*@cc_on
@if (@_jscript_version == 9)
            mode: 'shim',
@end
@*/

And I ended up having issues in Internet Explorer 9, it seems that the browser was making an other instance of my video that played over everything else and that I couldn't control at all. I ended up going with this instead.

if($.browser.msie && ($.browser.version == '8.0' || $.browser.version
== '7.0'))
        options.mode = 'shim';
查看更多
疯言疯语
3楼-- · 2019-01-25 14:40

Thanks a million for the investigative work and the solution — I ended up going with the slightly more separated code of

var options = {...}

/*@cc_on
  @if (@_jscript_version == 9)
    options.mode = 'shim';
  @end
@*/

$('video, audio').mediaelementplayer(options);
查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-01-25 14:41

Since your problem persists with your system only, there might be problem with either your setting or the flash player. Here are some things you may try:

  1. If you have any scripts running, try disabling those scripts and playing video again.
  2. If you have any secondary flash players such as "Gnash", try removing them.
  3. There is a slight possibility that your flassh player might be corrupted. Try re-installing it.
  4. If none of these work, try clearing cookies, cache, history.

You can also, re-install your Internet Explorer and see if it works. All the best! :)

查看更多
够拽才男人
5楼-- · 2019-01-25 14:46

I had the same problem and found an undocumented feature in another post: mode:shim ~ not sure of what its doing, specifically, but it seems to force all browsers to fall back on to flash.

Since chrome, ios, et al were working properly with html5 video, I used conditional comments to specify IE9 and force the fall back (flash or silverlight):

        var player = new MediaElementPlayer('video', {
/*@cc_on
@if (@_jscript_version == 9)
            mode: 'shim',
@end
@*/
            // remove or reorder to change plugin priority
            plugins: ['flash','silverlight'],

            // etc...

        }
查看更多
登录 后发表回答