feat: seasons, episodes and audio tracks (0.5.0) - #8
Merged
Merged
Conversation
Quality hunted for hls.js, dash.js, Shaka and Playerjs on its own, and audio tracks were about to hunt for the same four. The search moves into engines.js so both ask once, and findGlobalMatch becomes findGlobalMatches: one pass over the page's globals answers for every engine rather than one pass each.
Film sites often carry two or three dubs, and switching them from a phone was close to impossible. The row reads hls.js audioTracks, dash.js getTracksFor, Shaka's audio languages, Playerjs's own list and the audioTracks a browser exposes on the video element itself. The sheet grows a way to hide a row that has nothing to offer, so quality and audio both stay out of the way on a page with one of each.
A series on a Playerjs site keeps a path — the season, the dub, the episode —
and the player draws one control per step of it. Those are read and put in the
top-left corner of the player, laid out across, where a thumb reaches with the
phone held sideways: the season, then the episode, each opening a list with the
one being watched marked.
Playerjs answers next and prev but refuses an entry by index or by name:
api('playlist') is undefined, api('play', n) throws and api('find') returns
false. So a choice is made the way its own menu makes it — by pressing the row
the player drew. The rows are read again at the moment of the press, because
choosing a season has the player rebuild every step under it and rows held from
before that are detached.
A step with one entry in it is not a choice and is not drawn; a page that is a
film has no bar at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things a phone viewer cannot do on a film site, and now can.
Seasons and episodes
A series on a Playerjs site keeps a path — the season, the dub, the episode —
and the player draws one control per step of it. Nocturne reads those and puts
them in the top-left corner of the player, laid out across, where a thumb
reaches with the phone held sideways: the season, then the episode, each
opening a list with the one being watched marked. Picking an episode plays it
without leaving the player.
Playerjs answers
api('next')andapi('prev')but refuses an entry asked forby index or by name —
api('playlist')is undefined,api('play', n)throws,api('find')returns false. So a choice is made the way its own menu makes it:by pressing the row the player drew. The rows are read again at the moment of
the press, because choosing a season has the player rebuild every step under it
and rows held from before that are detached elements no press can reach.
A step with one entry in it is not a choice and is not drawn; a page that is a
film has no bar at all.
Audio tracks
Film sites often carry two or three dubs, and switching them from a phone was
close to impossible. The sheet grows a row for it, reading hls.js
audioTracks, dash.jsgetTracksFor('audio'), Shaka's audio languages,Playerjs's own list and the
audioTracksa browser exposes on the videoelement. Like quality, it stays hidden when there is nothing to choose between.
Also
Quality hunted for hls.js, dash.js, Shaka and Playerjs on its own, and audio
was about to hunt for the same four. That search moves into
engines.jssoboth ask once, and one pass over the page's globals now answers for every
engine rather than one pass each.
Privacy
Reads and presses on elements and objects the page already published. No code
injected, nothing evaluated from a string, no network, no new permissions. The
privacy check passes on 31 files.
Checked
web-ext lint(0 errors, 0 warnings)one; picking from it plays that episode