Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
6a9ab969
Commit
6a9ab969
authored
Nov 24, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use default controls for streamed video.
parent
58ba37d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
52 deletions
+58
-52
static/sfu.js
static/sfu.js
+58
-52
No files found.
static/sfu.js
View file @
6a9ab969
...
@@ -892,6 +892,7 @@ async function addFileMedia(file) {
...
@@ -892,6 +892,7 @@ async function addFileMedia(file) {
let
url
=
URL
.
createObjectURL
(
file
);
let
url
=
URL
.
createObjectURL
(
file
);
let
video
=
document
.
createElement
(
'
video
'
);
let
video
=
document
.
createElement
(
'
video
'
);
video
.
src
=
url
;
video
.
src
=
url
;
video
.
controls
=
true
;
/** @ts-ignore */
/** @ts-ignore */
let
stream
=
video
.
captureStream
();
let
stream
=
video
.
captureStream
();
...
@@ -1042,6 +1043,7 @@ function setMedia(c, isUp, video) {
...
@@ -1042,6 +1043,7 @@ function setMedia(c, isUp, video) {
div
.
appendChild
(
label
);
div
.
appendChild
(
label
);
}
}
if
(
!
video
)
{
let
template
=
document
.
getElementById
(
'
videocontrols-template
'
)
let
template
=
document
.
getElementById
(
'
videocontrols-template
'
)
.
firstElementChild
;
.
firstElementChild
;
let
top_template
=
document
.
getElementById
(
'
top-videocontrols-template
'
)
let
top_template
=
document
.
getElementById
(
'
top-videocontrols-template
'
)
...
@@ -1076,8 +1078,8 @@ function setMedia(c, isUp, video) {
...
@@ -1076,8 +1078,8 @@ function setMedia(c, isUp, video) {
camera
.
remove
();
camera
.
remove
();
}
}
if
(
!
video
)
media
.
srcObject
=
c
.
stream
;
media
.
srcObject
=
c
.
stream
;
}
setLabel
(
c
);
setLabel
(
c
);
setMediaStatus
(
c
);
setMediaStatus
(
c
);
...
@@ -1142,6 +1144,7 @@ function registerControlEvent(peerid) {
...
@@ -1142,6 +1144,7 @@ function registerControlEvent(peerid) {
}
}
let
pip
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.pip
"
));
let
pip
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.pip
"
));
if
(
pip
)
{
/** @ts-ignore */
/** @ts-ignore */
if
(
HTMLVideoElement
.
prototype
.
requestPictureInPicture
)
{
if
(
HTMLVideoElement
.
prototype
.
requestPictureInPicture
)
{
pip
.
onclick
=
function
(
event
)
{
pip
.
onclick
=
function
(
event
)
{
...
@@ -1153,8 +1156,10 @@ function registerControlEvent(peerid) {
...
@@ -1153,8 +1156,10 @@ function registerControlEvent(peerid) {
}
else
{
}
else
{
pip
.
style
.
display
=
'
none
'
;
pip
.
style
.
display
=
'
none
'
;
}
}
}
let
fs
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.fullscreen
"
));
let
fs
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.fullscreen
"
));
if
(
fs
)
{
fs
.
onclick
=
function
(
event
)
{
fs
.
onclick
=
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
let
fs
=
/** @type {HTMLElement} */
(
event
.
target
);
let
fs
=
/** @type {HTMLElement} */
(
event
.
target
);
...
@@ -1165,6 +1170,7 @@ function registerControlEvent(peerid) {
...
@@ -1165,6 +1170,7 @@ function registerControlEvent(peerid) {
displayWarning
(
"
Video Fullscreen not supported!
"
);
displayWarning
(
"
Video Fullscreen not supported!
"
);
}
}
};
};
}
let
camera
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.camera
"
));
let
camera
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.camera
"
));
if
(
camera
)
{
if
(
camera
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment