mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix gb28281 html rtc player stop
This commit is contained in:
parent
33b91cd6f2
commit
b391ed6206
1 changed files with 71 additions and 69 deletions
|
@ -123,8 +123,9 @@
|
|||
<div>
|
||||
<textarea class="span6" id="txt_rtc_url" rows="2"></textarea>
|
||||
<button class="btn btn-primary" id="btn_rtc_play">RTC播放</button>
|
||||
需要后台配置rtc功能才能正常启用, rtc配置请参考如下
|
||||
https://github.com/ossrs/srs/issues/307#issuecomment-602193458
|
||||
<div>RTC播放,需要后台启用RTC功能才能正常播放,
|
||||
<a href='https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki'>RTC配置参考</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<pre id="gb28181ChannelMessage" style="overflow:scroll; height:300px"></pre>
|
||||
|
@ -1090,6 +1091,14 @@
|
|||
startPlay($("#txt_rtc_url").val());
|
||||
});
|
||||
|
||||
|
||||
$("#rtc_player_modal").on("hide", function(){
|
||||
console.log("rtc stop");
|
||||
if (pc) {
|
||||
pc.close();
|
||||
}
|
||||
});
|
||||
|
||||
var startPlay = function(url) {
|
||||
$('#rtc_media_player').show();
|
||||
var urlObject = parse_rtmp_url(url);
|
||||
|
@ -1100,8 +1109,6 @@
|
|||
pc.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
pc = new RTCPeerConnection(null);
|
||||
pc.onaddstream = function (event) {
|
||||
console.debug(event.stream);
|
||||
|
@ -1159,13 +1166,8 @@
|
|||
throw reason;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
apply_url_change();
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue