From bf9f3dd08e64e1c5661d231e8105e7af2ade64c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Bj=C3=B6rneheim?= Date: Fri, 13 Feb 2026 11:44:00 +0100 Subject: [PATCH] fix: install Shaka polyfills before creating Player instance Shaka Player v4 requires shaka.polyfill.installAll() to be called before instantiating a Player. Without this, isBrowserSupported() returns false and DASH/MPD playback fails silently. Also comments out the dead MPD LIVE demo stream (404). Co-Authored-By: Claude Opus 4.6 --- packages/core/src/tech/ShakaTech.ts | 5 +++-- packages/demo/src/index.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/tech/ShakaTech.ts b/packages/core/src/tech/ShakaTech.ts index 795817f..870d7b4 100644 --- a/packages/core/src/tech/ShakaTech.ts +++ b/packages/core/src/tech/ShakaTech.ts @@ -1,5 +1,5 @@ //@ts-ignore -import { Player } from 'shaka-player'; +import shaka from 'shaka-player'; import { IWebPlayerOptions } from '../WebPlayer'; import BaseTech, { IVideoLevel, ITrack, getTextTrackId } from './BaseTech'; import { PlayerEvent } from '../util/constants'; @@ -10,7 +10,8 @@ export default class DashPlayer extends BaseTech { constructor(opts: IWebPlayerOptions) { super(opts); - this.shakaPlayer = new Player(this.video); + shaka.polyfill.installAll(); + this.shakaPlayer = new shaka.Player(this.video); const restrictToElementSize = !opts.disablePlayerSizeLevelCap; this.shakaPlayer.configure({ abr: { restrictToElementSize: restrictToElementSize } }); diff --git a/packages/demo/src/index.js b/packages/demo/src/index.js index c88d04e..f98f897 100644 --- a/packages/demo/src/index.js +++ b/packages/demo/src/index.js @@ -19,7 +19,7 @@ const ExampleStreams = [ { title: "MPD VOD", url: "https://lab.cdn.eyevinn.technology/osc/osc-reel/a4e1156e-f872-455f-9f1f-be73b5effba8/manifest.mpd" }, // { title: "HLS VOD SUBS & AUDIO", url: "http://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8"}, { title: "HLS LIVE", url: "https://d2fz24s2fts31b.cloudfront.net/out/v1/6484d7c664924b77893f9b4f63080e5d/manifest.m3u8" }, - { title: "MPD LIVE", url: "https://d2fz24s2fts31b.cloudfront.net/out/v1/3b6879c0836346c2a44c9b4b33520f4e/manifest.mpd" }, + // { title: "MPD LIVE", url: "https://d2fz24s2fts31b.cloudfront.net/out/v1/3b6879c0836346c2a44c9b4b33520f4e/manifest.mpd" }, // 404 - needs replacement { title: "HLS LIVE SSAI", url: "https://edfaeed9c7154a20828a30a26878ade0.mediatailor.eu-west-1.amazonaws.com/v1/master/1b8a07d9a44fe90e52d5698704c72270d177ae74/AdTest/master.m3u8" }, { title: "HLS LIVE SGAI", url: "https://eyevinn-sgaitest.eyevinn-sgai-ad-proxy.auto.prod.osaas.io/loop/master.m3u8" }, // { title: "WHEP", url: "https://srtwhep.lab.sto.eyevinn.technology:8443/channel" }