cbc.js (809B)
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 playButton = document.querySelector("video-ui .phx-play-btn"); 10 if (video.paused) { 11 playButton?.click(); 12 } 13 } 14 15 pause(video) { 16 let pauseButton = document.querySelector("video-ui .phx-pause-btn"); 17 if (!video.paused) { 18 pauseButton?.click(); 19 } 20 } 21 22 setMuted(video, shouldMute) { 23 let muteButton = document.querySelector("video-ui .phx-muted-btn"); 24 if (video.muted !== shouldMute) { 25 muteButton?.click(); 26 } 27 } 28 } 29 30 this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper;