mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
e2233027b8
commit
c210c0b2f5
2 changed files with 7 additions and 4 deletions
|
@ -53,6 +53,7 @@
|
|||
</footer>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var pc = null; // Global handler to do cleanup when replaying.
|
||||
$(function(){
|
||||
$('#rtc_media_player').hide();
|
||||
var query = parse_query_string();
|
||||
|
@ -63,7 +64,12 @@
|
|||
var urlObject = parse_rtmp_url($("#txt_url").val());
|
||||
var schame = window.location.protocol;
|
||||
|
||||
var pc = new RTCPeerConnection(null);
|
||||
// Close PC when user replay.
|
||||
if (pc) {
|
||||
pc.close();
|
||||
}
|
||||
|
||||
pc = new RTCPeerConnection(null);
|
||||
pc.onaddstream = function (event) {
|
||||
var player = document.getElementById('rtc_media_player');
|
||||
player.srcObject = event.stream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue