1、問題描述
在使用flv.js直播http-flv視頻流時,切換到瀏覽器其他tab也,然後再切換回視頻直播頁面時,直播畫面延時很高。
2、解決方案
設置定時任務 ,判斷視頻流是否是實時的,如果不是視頻流定向到當前時間。
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>flv.js demo</title>
<style>
.mainContainer {
display: block;
width: 1024px;
margin-left: auto;
margin-right: auto;
}
.urlInput {
display: block;
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 8px;
margin-bottom: 8px;
}
.centeredVideo {
display: block;
width: 100%;
height: 576px;
margin-left: auto;
margin-right: auto;
margin-bottom: auto;
}
.controls {
display: block;