-
Notifications
You must be signed in to change notification settings - Fork 425
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
refactor: remove duplicate bufferIntersection code #880
Changes from all 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
import videojs from 'video.js'; | ||
import logger from './util/logger'; | ||
import noop from './util/noop'; | ||
import { buffered } from './util/buffer'; | ||
import { bufferIntersection } from './ranges.js'; | ||
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. Use the one in ranges |
||
import {getMimeForCodec} from '@videojs/vhs-utils/dist/codecs.js'; | ||
|
||
const updating = (type, sourceUpdater) => { | ||
|
@@ -322,7 +322,15 @@ export default class SourceUpdater extends videojs.EventTarget { | |
} | ||
|
||
buffered() { | ||
return buffered(this.videoBuffer, this.audioBuffer); | ||
if (this.audioBuffer && !this.videoBuffer) { | ||
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. The only unique functionality in that file what using audio or video buffered, if we only had a buffer for one or the other. |
||
return this.audioBuffered(); | ||
} | ||
|
||
if (this.videoBuffer && !this.audioBuffer) { | ||
return this.videoBuffered(); | ||
} | ||
|
||
return bufferIntersection(this.audioBuffered(), this.videoBuffered()); | ||
} | ||
|
||
setDuration(duration, doneFn = noop) { | ||
|
This file was deleted.
This file was deleted.
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.
sounds like we can delete buffer.js?
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.
woops, removing