Skip to content

Commit

Permalink
feat(player): include ManagedMediaSource support check
Browse files Browse the repository at this point in the history
closes #961
  • Loading branch information
mihar-22 committed Jan 16, 2024
1 parent 1649a8a commit ab35874
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.

#### Core

- web component bundler plugins ([d97a9e1](https://github.com/vidstack/player/commit/d97a9e13a542952f8745584ca26dac1f32bb03f6))
- web component bundler plugins ([dfd4fa5](https://github.com/vidstack/player/commit/dfd4fa52431604d2b00a481364f213494c221f27))

#### Player

Expand All @@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file.
- new view, stream, and remote type tailwind variants ([e15aefc](https://github.com/vidstack/player/commit/e15aefc88a71b3a097ad6d5f0bf08573ed1df455))
- font style customization menu ([4e902b6](https://github.com/vidstack/player/commit/4e902b68d6c72835d6b4cbabdb06d4d411f73505))
- expose cancellable media request events on all components ([b6d84af](https://github.com/vidstack/player/commit/b6d84afed90f249587967b531188536ba81ead92))
- include `ManagedMediaSource` support check ([ef180c9](https://github.com/vidstack/player/commit/ef180c9a59fdfde6e52455936092c050696fca10))

#### Player (React)

Expand Down
1 change: 1 addition & 0 deletions packages/vidstack/dom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare global {
interface Window {
readonly chrome: boolean;
readonly safari: any;
readonly ManagedMediaSource: typeof MediaSource | undefined;
readonly WebKitMediaSource: typeof MediaSource | undefined;
readonly WebKitSourceBuffer: typeof SourceBuffer | undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vidstack/src/providers/hls/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class HLSProvider extends VideoProvider implements MediaProviderAdapter {
return true;
}

protected _library: HLSLibrary = `${JS_DELIVR_CDN}/npm/hls.js@^1.0.0/dist/hls${
protected _library: HLSLibrary = `${JS_DELIVR_CDN}/npm/hls.js@^1.5.0/dist/hls${
__DEV__ ? '.js' : '.min.js'
}`;

Expand Down
4 changes: 3 additions & 1 deletion packages/vidstack/src/utils/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export async function canChangeVolume() {
* @see {@link https://github.com/video-dev/hls.js/blob/master/src/is-supported.ts}
*/
export function getMediaSource(): typeof MediaSource | undefined {
return __SERVER__ ? undefined : window?.MediaSource ?? window?.WebKitMediaSource;
return __SERVER__
? undefined
: window?.ManagedMediaSource ?? window?.MediaSource ?? window?.WebKitMediaSource;
}

/**
Expand Down

0 comments on commit ab35874

Please sign in to comment.