Bug 1945643 - Update to mozilla-nimbus-schemas 2025.1.1 r=chumphreys
[gecko.git] / dom / media / mediasession / test / file_media_session.html
blob7cff7f4f69616d57543bc1234c1f4bd2955bdcfe
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Media Session and non-autoplay media</title>
5 </head>
6 <body>
7 <video id="testVideo" src="gizmo.mp4" loop></video>
8 <h1 id="result"></h1>
9 <script type="text/javascript">
11 const MediaSessionActions = [
12 "play",
13 "pause",
14 "seekbackward",
15 "seekforward",
16 "previoustrack",
17 "nexttrack",
18 "stop",
21 for (const action of MediaSessionActions) {
22 navigator.mediaSession.setActionHandler(action, () => {
23 document.getElementById("result").innerHTML = action;
24 document.getElementById("result").dispatchEvent(new CustomEvent("actionChanged"));
25 });
28 </script>
29 </body>
30 </html>