diff --git a/src/snippets/docs/player/api/providers/dash/wc/importing.ts b/src/snippets/docs/player/api/providers/dash/wc/importing.ts index 3a430af..8dcd2a9 100644 --- a/src/snippets/docs/player/api/providers/dash/wc/importing.ts +++ b/src/snippets/docs/player/api/providers/dash/wc/importing.ts @@ -1,8 +1,9 @@ import DASH from 'dashjs'; +import {isDASHProvider} from 'vidstack' player.addEventListener('provider-change', (event) => { const provider = event.detail; - if (provider?.type === 'dash') { + if (isDASHProvider(provider)) { // Static import provider.library = DASH; // Or, dynamic import diff --git a/src/snippets/docs/player/api/providers/hls/wc/importing.ts b/src/snippets/docs/player/api/providers/hls/wc/importing.ts index c67da92..67afef7 100644 --- a/src/snippets/docs/player/api/providers/hls/wc/importing.ts +++ b/src/snippets/docs/player/api/providers/hls/wc/importing.ts @@ -1,8 +1,9 @@ import HLS from 'hls.js'; +import {isHLSProvider} from 'vidstack' player.addEventListener('provider-change', (event) => { const provider = event.detail; - if (provider?.type === 'hls') { + if (isHLSProvider(provider)) { // Static import provider.library = HLS; // Or, dynamic import