New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix isSupported
check in browsers missing SourceBuffer
global
#2490
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,7 @@ export function isSupported (): boolean { | |||||
if (!mediaSource) { | ||||||
return false; | ||||||
} | ||||||
const sourceBuffer = SourceBuffer || (window as any).WebKitSourceBuffer; | ||||||
const sourceBuffer = (self as any).SourceBuffer || (self as any).WebKitSourceBuffer as SourceBuffer; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Requires a TypeScript update (done 2c4f7e6). I was getting this error and went for the easy fix instead of updating deps.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh maybe. I just checked locally in vscode and it had the types. If it doesn’t cause any issues I think keeping typescript up to date makes sense |
||||||
const isTypeSupported = mediaSource && | ||||||
typeof mediaSource.isTypeSupported === 'function' && | ||||||
mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍