playlist-loader-pc-mg-sequence.puml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. @startuml
  2. header PlaylistLoader sequences
  3. title PlaylistLoader sequences: Main Manifest and Alternate Audio
  4. Participant "PlaylistController" as PC #red
  5. Participant "MainPlaylistLoader" as MPL #blue
  6. Participant "mainSegmentLoader" as SL #blue
  7. Participant "AudioPlaylistLoader" as APL #green
  8. Participant "audioSegmentLoader" as ASL #green
  9. Participant "external server" as ext #brown
  10. Participant "m3u8Parser" as parser #orange
  11. Participant "mediaGroups" as MG #purple
  12. Participant Tech #lightblue
  13. == Initialization ==
  14. PC -> MPL : construct MainPlaylistLoader
  15. PC -> MPL: load()
  16. MPL -> MPL : start()
  17. == Requesting Main Manifest ==
  18. MPL -> ext: xhr request for main manifest
  19. ext -> MPL : response with main manifest
  20. MPL -> parser: parse main manifest
  21. parser -> MPL: object representing manifest
  22. note over MPL #lightblue: trigger 'loadedplaylist'
  23. == Requesting Video Manifest ==
  24. note over MPL #lightblue: handling loadedplaylist
  25. MPL -> MPL : media()
  26. MPL -> ext : request child manifest
  27. ext -> MPL: child manifest returned
  28. MPL -> parser: parse child manifest
  29. parser -> MPL: object representing the child manifest
  30. note over MPL #lightblue: trigger 'loadedplaylist'
  31. note over MPL #lightblue: handleing 'loadedplaylist'
  32. MPL -> SL: playlist()
  33. MPL -> SL: load()
  34. == Requesting Video Segments ==
  35. note over MPL #lightblue: trigger 'loadedmetadata'
  36. note over MPL #lightblue: handling 'loadedmetadata'
  37. opt vod and preload !== 'none'
  38. MPL -> SL: playlist()
  39. MPL -> SL: load()
  40. end
  41. MPL -> MG: setupMediaGroups()
  42. == Initializing Media Groups, Choosing Active Tracks ==
  43. MG -> APL: create child playlist loader for alt audio
  44. MG -> MG: activeGroup and audio variant selected
  45. MG -> MG: enable activeTrack, onTrackChanged()
  46. MG -> SL: reset mainSegmentLoader
  47. == Requesting Alternate Audio Manifest ==
  48. MG -> MG: startLoaders()
  49. MG -> APL: load()
  50. APL -> APL: start()
  51. APL -> ext: request alt audio media manifest
  52. break finish pending tasks
  53. MG -> Tech: add audioTracks
  54. MPL -> PC: setupSourceBuffers()
  55. MPL -> PC: setupFirstPlay()
  56. loop on monitorBufferTick
  57. SL -> ext: requests media segments
  58. ext -> SL: response with media segment bytes
  59. end
  60. end
  61. ext -> APL: responds with child manifest
  62. APL -> parser: parse child manifest
  63. parser -> APL: object representing child manifest returned
  64. == Requesting Alternate Audio Segments ==
  65. note over APL #lightblue: trigger 'loadedplaylist'
  66. note over APL #lightblue: handling 'loadedplaylist'
  67. APL -> ASL: playlist()
  68. note over APL #lightblue: trigger 'loadedmetadata'
  69. note over APL #lightblue: handling 'loadedmetadata'
  70. APL -> ASL: playlist()
  71. APL -> ASL: load()
  72. loop audioSegmentLoader.load()
  73. ASL -> ext: requests media segments
  74. ext -> ASL: response with media segment bytes
  75. end
  76. @enduml