我正在用最新的.m3u8 1.0.0 (不是rc),但2021-04-01版本的hls.js流.
小溪从下午5点开始,现在是下午5点15分.
在几乎所有的浏览器中,流都是从活动点开始的。
我在这里看到的模式是: android中的所有浏览器(在Android 10中测试)不会在实时点启动,只在0.
我做了所有的测试
·Safari桌面=>流5:15运行
·Safari移动=>流5:15直播
·WebView (安卓) =>···问题:播放器在0 (5pm)启动流
·WKWebView (苹果IOS iphone,ipad) =>流5:15直播
·(mac/win) =>流5:15运行
·Chrome (安卓) =>···问题:播放器在0 (5pm)启动流
·(iPhone) =>流5:15运行
·微软边缘桌面=>流5:15运行
·微软边缘移动(Android.MicrosoftEDGE) =>···问题:播放器在0 (5pm)启动流
·(mac/win) =>流5:15运行
·(mac/win) =>流5:15运行
·Opera Mini (iPhone) =>流5:15直播
·Opera Mini (android) =>···问题:播放器在0(下午5点)启动流
·(mac/win) =>流5:15直播
·勇敢的移动(iPhone) =>流5:15直播
·Brave (安卓) =>···问题:播放器在0 (5pm)启动流
这段代码
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<center><video width="90%" height="600" id="video" controls="" src="" playsinline="true" preload="metadata" ></video></center>
<script>
var video = document.getElementById("video");
var videoSrc = "https://www.example1.com/streaming/index.m3u8";
if (video.canPlayType("application/vnd.apple.mpegurl")) {
video.src = videoSrc;
} else if (Hls.isSupported()) {
var config = {
autoStartLoad: true,
startPosition: -1,
debug: false,
capLevelOnFPSDrop: false,
capLevelToPlayerSize: false,
defaultAudioCodec: undefined,
initialLiveManifestSize: 1,
maxBufferLength: 30,
maxMaxBufferLength: 500,
backBufferLength: Infinity,
maxBufferSize: 60 * 1000 * 1000,
maxBufferHole: 0.5,
highBufferWatchdogPeriod: 2,
nudgeOffset: 0.1,
nudgeMaxRetry: 3,
maxFragLookUpTolerance: 0.25,
liveSyncDurationCount: 3,
liveMaxLatencyDurationCount: Infinity,
liveDurationInfinity: false,
enableWorker: true,
enableSoftwareAES: true,
manifestLoadingTimeOut: 10000,
manifestLoadingMaxRetry: 1,
manifestLoadingRetryDelay: 1000,
manifestLoadingMaxRetryTimeout: 64000,
startLevel: undefined,
levelLoadingTimeOut: 10000,
levelLoadingMaxRetry: 4,
levelLoadingRetryDelay: 1000,
levelLoadingMaxRetryTimeout: 64000,
fragLoadingTimeOut: 20000,
fragLoadingMaxRetry: 6,
fragLoadingRetryDelay: 1000,
fragLoadingMaxRetryTimeout: 64000,
startFragPrefetch: false,
testBandwidth: true,
progressive: false,
lowLatencyMode: true,
fpsDroppedMonitoringPeriod: 5000,
fpsDroppedMonitoringThreshold: 0.2,
appendErrorMaxRetry: 3,
enableWebVTT: true,
enableIMSC1: true,
enableCEA708Captions: true,
stretchShortVideoTrack: false,
maxAudioFramesDrift: 1,
forceKeyFrameOnDiscontinuity: true,
abrEwmaFastLive: 3.0,
abrEwmaSlowLive: 9.0,
abrEwmaFastVoD: 3.0,
abrEwmaSlowVoD: 9.0,
abrEwmaDefaultEstimate: 500000,
abrBandWidthFactor: 0.95,
abrBandWidthUpFactor: 0.7,
abrMaxWithRealBitrate: false,
maxStarvationDelay: 4,
maxLoadingDelay: 4,
minAutoBitrate: 0,
emeEnabled: false
};
var hls = new Hls(config);
hls.loadSource(videoSrc);
hls.attachMedia(video);
}
video.addEventListener("loadedmetadata", function(){ video.muted = true; video.play(); }, false);
</script>//在这里我添加了video.muted = true;video.play();以自动启动,如果我尝试自动播放,许多浏览器拒绝此命令.
// playsinline="true“用于狩猎活动
···FFMPEG命令(工作:它允许我有3到4秒的延迟···
ffmpeg -re -i input.x -c:a aac -c:v libx264
-movflags +dash -preset ultrafast
-crf 28 -refs 4 -qmin 4 -pix_fmt yuv420p
-tune zerolatency -c:a aac -ac 2 -profile:v main
-flags -global_header -bufsize 969k
-hls_time 1 -hls_list_size 0 -g 30
-start_number 0 -streaming 1 -hls_playlist 1
-lhls 1 -hls_playlist_type event -f hls path_to_index.m3u8•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
怎么解决这个问题呢?
我怎样才能在android手机的负载下发挥作用?
发布于 2021-04-03 01:27:26
我试过video.currentTime = ( parseFloat(video.duration) - 1 );这个,它正在工作;)
视频标签
<video width="90%" height="600" id="video"
controls="" src="" playsinline="true" preload="metadata" ></video>还有剧本
<script>
video = document.getElementById("video");
//the regular HLS portion loadSource attachMedia...
video.addEventListener("loadedmetadata", function({
video.muted = true;
setTimeout(function(){
video.currentTime = ( parseFloat(video.duration) - 1 );video.play();
}, 1169);
}, false);
<script>视频标签中的preload=“元数据”很重要,因为video.addEventListener("loadedmetadata"具有魔力.
https://stackoverflow.com/questions/66926044
复制相似问题