mirror of
https://github.com/jech/galene.git
synced 2024-11-26 02:25:58 +01:00
Use default controls for streamed video.
This commit is contained in:
parent
58ba37d8da
commit
6a9ab96902
1 changed files with 57 additions and 51 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue