flv.js播放flv

flv cdn
https://www.bootcdn.cn/flv.js/

举例

		<script src="dist/js/flv.min.js"></script>
		<video id="videoElement" controls autoplay width="1024" height="576"></video>
		<script>
			if (flvjs.isSupported()) {
				var videoElement = document.getElementById('videoElement');
				var flvPlayer = flvjs.createPlayer({
					type: 'flv',
					url: 'http://39.106.70.134:8100/flv?port=1935&app=live'
				});
				flvPlayer.attachMediaElement(videoElement);
				flvPlayer.load();
				flvPlayer.play();
			}
		</script>

运行效果

posted @ 2021-04-06 18:23  thomas_blog  阅读(998)  评论(0编辑  收藏  举报