radiocanada.js (924B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 class PictureInPictureVideoWrapper { 8 play(video) { 9 let playPauseButton = document.querySelector( 10 ".rcplayer-btn.rcplayer-smallPlayPauseBtn" 11 ); 12 if (video.paused) { 13 playPauseButton?.click(); 14 } 15 } 16 17 pause(video) { 18 let playPauseButton = document.querySelector( 19 ".rcplayer-btn.rcplayer-smallPlayPauseBtn" 20 ); 21 if (!video.paused) { 22 playPauseButton?.click(); 23 } 24 } 25 26 setMuted(video, shouldMute) { 27 let muteButton = document.querySelector( 28 ".rcplayer-bouton-with-panel--volume .rcplayer-btn" 29 ); 30 if (video.muted !== shouldMute) { 31 muteButton?.click(); 32 } 33 } 34 } 35 36 this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper;