Skip to content
Open
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<main-page></main-page>
<video-page></video-page>
<banner-page></banner-page>
<script type="text/javascript" src="https://senza-sdk.streaming.synamedia.com/latest/bundle.js"></script>
<script type="module" src="script.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/shaka-player/4.12.5/shaka-player.compiled.js"></script>
</body>
Expand Down
11 changes: 11 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
await senza.init();

import "./src/widgets/player.js";

import "./src/page/main.js";
import "./src/page/video.js";
import "./src/page/banner.js";

window.addEventListener('load', function () {
senza.lifecycle.configure({
autoBackground: {enabled: true, timeout: {playing: 15, idle: 15}}
autoSuspend: {enabled: true, timeout: {playing: 15, idle: 15}}
});

senza.uiReady();
});
2 changes: 1 addition & 1 deletion src/widgets/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class PlayerWidget extends HTMLElement {
this.video = createElement(this.shadowRoot, {
className: "root"
}, "video");
this.player = new shaka.Player();
this.player = new senza.ShakaPlayer();
this.player.attach(this.video);
this.playMode = false;
this.video.addEventListener('canplay', () => {
Expand Down