This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <video id="mediaVideo" src="img/Westminster_high.mp4" controls></video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof Windows !== 'undefined') { | |
| var systemMediaControls = Windows.Media.SystemMediaTransportControls.getForCurrentView(); | |
| systemMediaControls.addEventListener("buttonpressed", systemMediaControlsButtonPressed, false); | |
| systemMediaControls.isPlayEnabled = true; | |
| systemMediaControls.isPauseEnabled = true; | |
| systemMediaControls.isStopEnabled = true; | |
| systemMediaControls.playbackStatus = Windows.Media.MediaPlaybackStatus.closed; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("DOMContentLoaded", function () { | |
| var videoElement = document.getElementById("mediaVideo"); | |
| videoElement.addEventListener("pause", mediaPaused); | |
| videoElement.addEventListener("playing", mediaPlaying); | |
| videoElement.addEventListener("ended", mediaEnded); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mediaPlaying() { | |
| // Update the SystemMediaTransportControl state. | |
| systemMediaControls.playbackStatus = Windows.Media.MediaPlaybackStatus.playing; | |
| } | |
| function mediaPaused() { | |
| // Update the SystemMediaTransportControl state. | |
| systemMediaControls.playbackStatus = Windows.Media.MediaPlaybackStatus.paused; | |
| } | |
| function mediaEnded() { | |
| // Update the SystemMediaTransportControl state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function playMedia() { | |
| var media = document.getElementById("mediaVideo"); | |
| media.play(); | |
| } | |
| function pauseMedia() { | |
| var media = document.getElementById("mediaVideo"); | |
| media.pause(); | |
| } | |
| function stopMedia() { | |
| var media = document.getElementById("mediaVideo"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <video id="mediaVideo" src="img/Westminster_high.mp4" msAudioCategory="BackgroundCapableMedia" controls></video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Extensions> | |
| <Extension Category="windows.backgroundTasks" StartPage="index.html"> | |
| <BackgroundTasks> | |
| <Task Type="audio" /> | |
| </BackgroundTasks | |
| </Extension> | |
| </Extensions> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("DOMContentLoaded", function () { | |
| var videoElement = document.getElementById("mediaVideo"); | |
| videoElement.addEventListener("msfullscreenchange", fullScreen); | |
| videoElement.addEventListener("webkitfullscreenchange", fullScreen); | |
| videoElement.addEventListener("fullscreenchange", fullScreen); | |
| videoElement.addEventListener("mozfullscreenchange", fullScreen); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fullScreen() { | |
| console.log("fullscreenchange"); | |
| if (typeof Windows !== 'undefined') { | |
| var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView(); | |
| if(view.IsFullScreenMode) { | |
| console.log("Exiting WinRT Fullscreen"); | |
| view.ExitFullScreenMode(); | |
| } | |
| else { | |
| console.log("Entering WinRT Fullscreen"); |