Replacing media source (http with rtmp) in MediaElementsJS based on browser capabilities

◇◆丶佛笑我妖孽 提交于 2019-12-01 11:23:09

I've just found the answer to my own question through Github issue tracker for MediaElementJS:

https://github.com/johndyer/mediaelement/issues/337

The trick is adding "mp4:" before the name of the media file in the URL. So, in my example, the last lines would be:

if (media.pluginType != 'native') {
    media.setSrc('rtmp://localhost/mp4:video1.mp4'); // NOTE the "mp4:" prefix
    media.load();
    media.play();
}

It works for us on Flash Media Server 3.5. :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!