'How to play rtmp live stream in web browser?
I am trying the rtmp url in video js player.But it was not working .
In video js we have to give the type(application/x-mpegURL | video/mp4) in the source.
<video id="wiPlayer" class="video-js vjs-default-skin"
controls codecs="avc1.4D401E, mp4a.40.2" preload="auto" width="1200" height="400" poster="<?=$post->screenShotUrl?>"
data-setup='{"aspectRatio":"640:320", "autoplay": true, "controlBar": {"fullscreenToggle": true, "progressControl": true}}'>
<p class="vjs-no-js">We're sorry, but your browser doesn't support Video</p>
</video>
the js code is
player = videojs('wiPlayer');
player.src({
src: stream_url,
type: mPlayerType,// "video/mp4",//application/x-mpegURL
useCueTags: true
});
window.onOrientation(player, 'wiPlayer');
player.play();
for me the url is like :
rtmp://vid-11239002.pull.usnecenter.broadcastapp.agora.cn/live/public1265537
How can i play this kind of live stream urls with video js? or do we have any other solution for this?
Solution 1:[1]
The type for RTMP is rtmp/mp4 or rtmp/flv. This will only work on a browser that has Flash.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | misterben |
