Fonction pour couper le son
This commit is contained in:
parent
497f0dd9cc
commit
94928f98cd
20
index.html
20
index.html
@ -205,13 +205,21 @@
|
|||||||
var masthead_video = document.getElementById("masthead-video");
|
var masthead_video = document.getElementById("masthead-video");
|
||||||
var video_button = document.getElementById("video-sound");
|
var video_button = document.getElementById("video-sound");
|
||||||
|
|
||||||
|
masthead_video_mute(mute) {
|
||||||
|
masthead_video.muted = mute;
|
||||||
|
if (mute) {
|
||||||
|
video_button.children[0].children[0].setAttribute("xlink:href", "/vector/sprite.svg#sound-off");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
video_button.children[0].children[0].setAttribute("xlink:href", "/vector/sprite.svg#sound-on");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
video_button.onclick = function () {
|
video_button.onclick = function () {
|
||||||
if (masthead_video.muted) {
|
if (masthead_video.muted) {
|
||||||
masthead_video.muted = false;
|
masthead_video_mute(false);
|
||||||
video_button.children[0].children[0].setAttribute("xlink:href", "/vector/sprite.svg#sound-on");
|
|
||||||
} else {
|
} else {
|
||||||
masthead_video.muted = true;
|
masthead_video_mute(true);
|
||||||
video_button.children[0].children[0].setAttribute("xlink:href", "/vector/sprite.svg#sound-off");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -228,7 +236,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#youtubeModal').on('show.bs.modal', function (event) {
|
$('#youtubeModal').on('show.bs.modal', function (event) {
|
||||||
document.getElementById("masthead-video").muted = true;
|
masthead_video_mute(true);
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var youtube_id = button.data('youtubeid');
|
var youtube_id = button.data('youtubeid');
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
@ -239,7 +247,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#vimeoModal').on('show.bs.modal', function (event) {
|
$('#vimeoModal').on('show.bs.modal', function (event) {
|
||||||
document.getElementById("masthead-video").muted = true;
|
masthead_video_mute(true);
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var vimeo_id = button.data('vimeoid');
|
var vimeo_id = button.data('vimeoid');
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user