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

后端 未结 1 2003
日久生厌
日久生厌 2021-01-25 20:10

First of all, in case John Dyer is reading this, thanks a lot for your player, it\'s fantastic! :-)

And now, to my problem. I\'m trying to provide an MP4 video using HT

相关标签:
1条回答
  • 2021-01-25 20:52

    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. :-)

    0 讨论(0)
提交回复
热议问题