123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- @startuml
- header DashPlaylistLoader sequences
- title DashPlaylistLoader sequences: Main Manifest with Alternate Audio
- Participant "PlaylistController" as PC #red
- Participant "MainDashPlaylistLoader" as MPL #blue
- Participant "mainSegmentLoader" as SL #blue
- Participant "AudioDashPlaylistLoader" as APL #green
- Participant "audioSegmentLoader" as ASL #green
- Participant "external server" as ext #brown
- Participant "mpdParser" as parser #orange
- Participant "mediaGroups" as MG #purple
- Participant Tech #lightblue
- == Initialization ==
- PC -> MPL : construct MainPlaylistLoader
- PC -> MPL: load()
- == Requesting Main Manifest ==
- MPL -> MPL : start()
- MPL -> ext: xhr request for main manifest
- ext -> MPL : response with main manifest
- MPL -> parser: parse manifest
- parser -> MPL: object representing manifest
- note over MPL #lightblue: trigger 'loadedplaylist'
- == Requesting Video Manifest ==
- note over MPL #lightblue: handling loadedplaylist
- MPL -> MPL: media(x)
- alt if no sidx
- note over MPL #lightgray: zero delay to fake network request
- else if sidx
- break
- MPL -> ext: request sidx
- end
- end
- note over MPL #lightblue: trigger 'loadedmetadata' on main loader [T1]
- note over MPL #lightblue: handling 'loadedmetadata'
- opt vod and preload !== 'none'
- MPL -> SL: playlist()
- MPL -> SL: load()
- end
- == Initializing Media Groups, Choosing Active Tracks ==
- MPL -> MG: setupMediaGroups()
- MG -> MG: initialize()
- == Initializing Alternate Audio Loader ==
- MG -> APL: create child playlist loader for alt audio
- MG -> MG: activeGroup and audio variant selected
- MG -> MG: enable activeTrack, onTrackChanged()
- MG -> ASL: reset audio segment loader
- == Requesting Alternate Audio Manifest ==
- MG -> MG: startLoaders()
- MG -> APL: load()
- APL -> APL: start()
- APL -> APL: zero delay to fake network request
- break finish pending tasks
- MG -> Tech: add audioTrack
- MPL -> PC: setupSourceBuffers_()
- MPL -> PC: setupFirstPlay()
- loop mainSegmentLoader.monitorBufferTick_()
- SL -> ext: requests media segments
- ext -> SL: response with media segment bytes
- end
- end
- APL -> APL: zero delay over
- APL -> APL: media(x)
- alt if no sidx
- note over APL #lightgray: zero delay to fake network request
- else if sidx
- break
- MPL -> ext: request sidx
- end
- end
- == Requesting Alternate Audio Segments ==
- note over APL #lightblue: trigger 'loadedplaylist'
- note over APL #lightblue: handling 'loadedplaylist'
- APL -> ASL: playlist()
- note over ASL #lightblue: trigger 'loadedmetadata' [T2]
- note over APL #lightblue: handling 'loadedmetadata'
- APL -> ASL: playlist()
- APL -> ASL: load()
- loop audioSegmentLoader.monitorBufferTick_()
- ASL -> ext: requests media segments
- ext -> ASL: response with media segment bytes
- end
- @enduml
|