-
Notifications
You must be signed in to change notification settings - Fork 5
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
[JW8-8804] Typescript level, audio and subtitle track controllers #207
[JW8-8804] Typescript level, audio and subtitle track controllers #207
Conversation
9061439
to
b29f8d4
Compare
…er and manifest event output JW8-8804
b29f8d4
to
ec9011b
Compare
|
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.
LGTM overall, let's regroup on the level empty error stuff
newId = i; | ||
break; | ||
} | ||
} | ||
|
||
if (newId === previousId) { | ||
logger.warn(`No fallback audio-track found for name/language: "${name}" / "${language}"`); | ||
logger.warn(`No fallback audio-track found for name/language: "${name}" / "${lang}"`); |
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.
Can you add a log prefix to this (and other) statements? It can just go in the string instead of being in a separate method like the controllers. logger.log([class-name]: ...
)
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.
Everything extends EventHandler
so why don't we put log
and warn
on EventHandler
instead of BaseStreamController
?
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.
done
src/types/level.ts
Outdated
@@ -0,0 +1,83 @@ | |||
import LevelDetails from '../loader/level'; | |||
|
|||
export interface SingleLevel { |
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.
Maybe better named as BaseLevel
?
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.
It's not a base class. It's the interface of the object emitted when only a single playlist is loaded (no master manifest).
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.
Removed. I added attr: {}
and bitrate: 0
to the [singleLevel]
result from the m3u8 parser so that we don't have to worry about checking these types everywhere.
|
|
JW8-8804
|
|
This PR will...
firstLevel
to-1
so that it doesn't show up asNaN
on the player api before loading a manifest.realBitrate
to0
to provide strong typing. This simplifies max bitrate calculation in abr-controller.jsdeltaPTS
andmaxStartPTS
properties toFragment
SingleLevel
LevelParsed
PlaylistMedia
LevelAttributes
ManifestLoadedData
ManifestParsedData
TrackLoadedData
LevelLoadedData
AudioTrackSwitchedData
FragLoadedData
MediaAttachedData
ErrorData
this._levels
is null, rather than let an undefined exception occur later in the methods that are susceptible to this.window.setTimeout():number
Why is this Pull Request needed?
Typing these modules provides type checking for controllers that load manifests and create level and track arrays. We can see which properties are nullable and reason whether stronger typing is required in some cases.
Are there any points in the code the reviewer needs to double check?
Suggest alternatives to 'No Levels' exception. I don't think just returning when levels is null is a good solution. Existing behavior would be an exception - now it's explicit.
Are the types/events.ts and types/level.ts a good place to put some of these new interfaces or is there another convention for organizing interfaces and classes together or separately?
Resolves issues:
JW8-8804