Skip to content

Commit

Permalink
added loading of 1750 ms to resolution change. ant-media/Ant-Media-Se…
Browse files Browse the repository at this point in the history
  • Loading branch information
eneskuluk committed May 17, 2021
1 parent fa3967b commit 880c4ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Binary file added src/main/webapp/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/main/webapp/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
.options {
display:none;
}
#video-overlay {
margin: 0 auto;
display: none;
z-index: 9999999;
}
</style>
</head>
<body>
Expand All @@ -70,6 +75,9 @@ <h3 class="col text-muted">WebRTC Play</h3>
<div class="jumbotron">

<div class="col-sm-12 form-group">
<div id='video-overlay'>
<img src="images/loading.gif" />
</div>
<video id="remoteVideo" autoplay controls playsinline ></video>
</div>
<div class="form-group col-sm-12 text-left">
Expand Down Expand Up @@ -321,9 +329,14 @@ <h3 class="col text-muted">WebRTC Play</h3>

// Remove p character in stream resolution
dropdownSelectedItem = dropdownSelectedItem.replace('p', '');

let getVideo = document.getElementById("remoteVideo");
let overlay = document.getElementById('video-overlay');
getVideo.pause();
overlay.style.display = "block";
getVideo.style.display = "none";
// Call set stream resolution
webRTCAdaptor.forceStreamQuality(streamId, Number(dropdownSelectedItem));
setTimeout(function(){ getVideo.play();overlay.style.display = "none"; getVideo.style.display = "block"; }, 1750);
// Remove current active item
$('a.dropdown-item.active').removeClass("active");
// Add active in new item
Expand Down

0 comments on commit 880c4ad

Please sign in to comment.