我有很多频道" ffmpeg" (4个频道)自动启动,我创建一个代码显示第一个频道,5秒后显示第二个..等等所有事情都是正确但我有一个小问题,秒频道没有自动启动,我需要停止第一个频道
4通道工作代码100%,但没有显示第一通道的功能,5秒后显示第二通道......等等
<?php
ffmpeg -i http://clay24.webhop.net:8000/live/mario/mario/13.ts -i http://clay24.webhop.net:8000/live/mario/mario/12.ts -i http://clay24.webhop.net:8000/live/mario/mario/10.ts -map 0 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/1 -map 1 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/21 -map 2 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/24
?>
&#13;
带功能的第二个代码
<?php
echo'
<script>
window.addEventListener("load", function() {
var urls = iframes = [ "'; ffmpeg -i http://mygameravatar.zapto.org:43666/live/test1/test2/81.ts -c:a aac -b:a 64k -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/2
echo '];
var iframes = document.querySelectorAll("div");
var n = 0;
var interval = setInterval(function() {
iframes[++n].src = urls[n - 1];
iframes[n].style.display = "block";
console.log(n);
if (n === iframes.length -1) {
clearInterval(interval);
console.log("all iframes loaded")
}
}, 5000)
})
</script>
<style>
.channel {
display:none;
}
</style>
</head>
<body>
<div>
';
ffmpeg -i http://mygameravatar.zapto.org:43666/live/test1/test2/297.ts -c:a aac -b:a 64k -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/1
echo '</div>
<div class="channel">
</div>
</body>
</html>';
?>
&#13;