Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pédagogies Multimodales
Phonographe
Commits
ba93ecab
Commit
ba93ecab
authored
Apr 14, 2021
by
Sylvain Coulange
Browse files
ajout détecteur Safari pour ajout controls sur #video
parent
3ec1162d
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/playerPhono.html
View file @
ba93ecab
...
...
@@ -149,6 +149,18 @@
<source
id=
"videoSrc"
src=
"../../media/video-uploads/chat.mp4"
type=
"video/mp4"
>
Votre navigateur ne permet pas de lire cette vidéo.
</video><br>
<script>
// If browser = safari, ajouter les controls de la vidéo
// Detect Safari
let
safariAgent
=
navigator
.
userAgent
.
indexOf
(
"
Safari
"
)
>
-
1
;
let
chromeAgent
=
navigator
.
userAgent
.
indexOf
(
"
Chrome
"
)
>
-
1
;
// Discard Safari since it also matches Chrome
if
((
chromeAgent
)
&&
(
safariAgent
))
safariAgent
=
false
;
console
.
log
(
"
SafariAgent:
"
,
safariAgent
)
if
(
safariAgent
){
document
.
getElementById
(
'
video
'
).
setAttribute
(
'
controls
'
,
true
)
}
</script>
<button
type=
"button"
class=
"btn mx-auto"
onclick=
"playVideo()"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"30"
height=
"30"
fill=
"currentColor"
class=
"bi bi-play-fill"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.596 8.697l-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"
/>
...
...
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