Use default controls for streamed video.
This commit is contained in:
+7
-1
@@ -892,6 +892,7 @@ async function addFileMedia(file) {
|
||||
let url = URL.createObjectURL(file);
|
||||
let video = document.createElement('video');
|
||||
video.src = url;
|
||||
video.controls = true;
|
||||
/** @ts-ignore */
|
||||
let stream = video.captureStream();
|
||||
|
||||
@@ -1042,6 +1043,7 @@ function setMedia(c, isUp, video) {
|
||||
div.appendChild(label);
|
||||
}
|
||||
|
||||
if(!video) {
|
||||
let template = document.getElementById('videocontrols-template')
|
||||
.firstElementChild;
|
||||
let top_template = document.getElementById('top-videocontrols-template')
|
||||
@@ -1076,8 +1078,8 @@ function setMedia(c, isUp, video) {
|
||||
camera.remove();
|
||||
}
|
||||
|
||||
if(!video)
|
||||
media.srcObject = c.stream;
|
||||
}
|
||||
|
||||
setLabel(c);
|
||||
setMediaStatus(c);
|
||||
@@ -1142,6 +1144,7 @@ function registerControlEvent(peerid) {
|
||||
}
|
||||
|
||||
let pip = /** @type {HTMLElement} */(peer.querySelector("span.pip"));
|
||||
if(pip) {
|
||||
/** @ts-ignore */
|
||||
if(HTMLVideoElement.prototype.requestPictureInPicture) {
|
||||
pip.onclick = function(event) {
|
||||
@@ -1153,8 +1156,10 @@ function registerControlEvent(peerid) {
|
||||
} else {
|
||||
pip.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
let fs = /** @type {HTMLElement} */(peer.querySelector("span.fullscreen"));
|
||||
if(fs) {
|
||||
fs.onclick = function(event) {
|
||||
event.preventDefault();
|
||||
let fs = /** @type {HTMLElement} */(event.target);
|
||||
@@ -1165,6 +1170,7 @@ function registerControlEvent(peerid) {
|
||||
displayWarning("Video Fullscreen not supported!");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let camera = /** @type {HTMLElement} */(peer.querySelector("span.camera"));
|
||||
if(camera) {
|
||||
|
||||
Reference in New Issue
Block a user