5

We're having problems with Chrome crashing, and it seems to be related to the html5 video player, is there any way to force MediaElement.js to use the flash player even if html5 is supported? I can do a browser test in jQuery if I can figure out what setting to pass to mediaelement.

I've seen a few tantalizing suggestions in blogs and forums that this can be done, but I'm not seeing a specific option in the documentation. Any help would be very much appreciated!

David
  • 51
  • 1
  • 3
  • Wonder if it's related to this: http://stackoverflow.com/questions/11393050 - I've been having massive problems getting h264 files to either play or to gracefully fall back to flash using me.js, videojs or any other html5 with fallback solution... the maybe-to-no fix seems to basically make all browsers fall back to Flash, including IE9+... – Oskar Duveborn Feb 20 '13 at 14:48

3 Answers3

14

Here you go:

new MediaElementPlayer('video',{mode:'shim'});
John Dyer
  • 1,005
  • 9
  • 15
  • 3
    the documentation listing "all options" lacks the above option, making me wonder what else is there! ;) – Tom May 02 '11 at 09:20
  • Yep, need to do some updating of the docs. You can always check the options in the code to see what's available. – John Dyer May 23 '11 at 17:39
  • 1
    Adding "mode: 'shim'" has no effect on my Chrome :( – greg Mar 25 '14 at 12:28
3

I used the mode:shim on a site that was giving inexplicable problems with IE9's html5 interpretation. however, this mode tag forced all browsers to fall back to flash, and this was not desirable.

So I used conditional comments to specify IE9 and force it to use flash (or silverlight if that's your preference)

var player = new MediaElementPlayer('video', {
    /*@cc_on
    @if (@_jscript_version == 9)
            mode: 'shim',
    @end
    @*/
    // shows debug errors on screen
    enablePluginDebug: false,

    // etc...
}

This won't work for chrome, and I don't know of a chrome-specific workaround, but for anyone who stumbled on this answer as I did for IE problems, I hope it helps.

In reference to: Mediaelement.js malfunction in IE, no flashback works.

Community
  • 1
  • 1
russ24
  • 133
  • 2
  • 12
0

You have to modify the code to achieve this . Find below given code in MediaElement.js or mediaelement-and-player.js file.

 t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid );

to

t.supportsMediaTag =  ( !t.isChrome) && (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid ) ;
Shiv
  • 1,269
  • 11
  • 20