Skip to content
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: align DashPlaylistLoader closer to PlaylistLoader states #386

Merged
merged 19 commits into from
Feb 27, 2019

Conversation

ldayananda
Copy link
Contributor

@ldayananda ldayananda commented Jan 24, 2019

Description

This is a change to ensure that DashPlaylistLoader and PlaylistLoader follow a similar setup path. This should make it easier for sidx boxes received to result in further XHR requests in particular DASH Media Presentations, e.g SegmentBase with indexRange

Specific Changes proposed

  1. DashPlaylistLoader should go through the following states:

HAVE_NOTHING -> HAVE_MASTER -> HAVE_METADATA

  1. DashPlaylistLoader should trigger the following events:
  • loadedplaylist when the master playlist is setup after requesting or refreshing the mpd
  • loadedplaylist when a video playlist has finished being selected, or a child playlist(for media groups) has finished being selected
  • loadedmetadata the first time a media playlist has been loaded for a specific loader
  1. updateMaster should return null if there are no manifest changes

  2. Wait until audioPlaylistLoader has set media to trigger selectedinitalmedia

  3. We now use hasPendingRequest to automatically select a media playlist for the masterPlaylistLoader as a fallback in case one is not selected by MPC. The child loaders are created with a media playlist so this fallback is not necessary for them.

Sources to use for testing:

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Unit Tests updated or fixed
    • New unit tests added
    • Docs/guides updated
  • Reviewed by Two Core Contributors

mjneil
mjneil previously requested changes Jan 30, 2019
ldayananda added 5 commits February 7, 2019 17:18
…urns and once when the initial media is selected
- start DashPlaylistLoader in HAVE_NOTHING state
- enter HAVE_METADATA in media() method
- set media automatically only for child playlist loader as masterPlaylistLoader is set from masterPlaylistController

update tests with desired behavior

ensure loadedmetadata is triggered after loadedplaylist

remove unnecessary media playlist selection for master loader
- delay triggering selectedinitialmedia event until the active audio playlist loader is finished setting media

- ensure that HLS playlists without alternate audio are not affected
@@ -2915,6 +2915,50 @@ QUnit.test('configures eme if present on selectedinitialmedia', function(assert)
}, 'set source eme options');
});

QUnit.test('integration: configures eme if present on selectedinitialmedia', function(assert) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test above this tests the same thing, but with all the playlist loaders mocked. Should we keep both?

ldayananda added 3 commits February 11, 2019 17:49
- don't autoselect media for the masterPlaylistLoader as that is done by MasterPlaylistController
- ensure updateMaster returns null if there are no changes in the playlist
- trigger loadedmetadata as part of haveMetadata
- add some comments to explain why we trigger certain events and set media at points
- moving haveMetadata to a class-level method, more comments.

- remove setTimeouts as they were not performing a necessary function. XHR requests can return in any amount of time and HLS PlaylistLoader handles any requests within a callback, or returns if a request need not be made. DASH should do the same

- cleanup the minimumUpdatePeriod setup

- remove unnecessary clock.ticks from tests
ldayananda added 2 commits February 11, 2019 21:35
- add DashPlaylistLoader doc
- move intro.md to be README in the docs directory to increase visibility
- update glossary.md with specific DPL reference
ldayananda added 7 commits February 12, 2019 14:41
- fix up a comment
- add idea for media groups refactor
- add new unit test module for DPL
- add tests for updateMaster
- add tests for DPL for: constructor, load, media, haveMetadata, refreshMedia_
@ldayananda ldayananda changed the title [WIP] align DashPlaylistLoader closer to PlaylistLoader states chore: align DashPlaylistLoader closer to PlaylistLoader states Feb 14, 2019
…mention hasPendingRequest for fallback media selection
@forbesjo forbesjo assigned forbesjo and unassigned forbesjo Feb 15, 2019
@forbesjo forbesjo self-requested a review February 15, 2019 15:41
@ldayananda ldayananda self-assigned this Feb 25, 2019
@ldayananda ldayananda changed the title chore: align DashPlaylistLoader closer to PlaylistLoader states refactor: align DashPlaylistLoader closer to PlaylistLoader states Feb 27, 2019
@ldayananda ldayananda merged commit 5d80fe7 into videojs:master Feb 27, 2019
@ldayananda ldayananda deleted the dash-loader-fix branch February 27, 2019 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants