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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @startuml
  2. header DashPlaylistLoader sequences
  3. title DashPlaylistLoader sequences: Main Manifest with Alternate Audio
  4. Participant "PlaylistController" as PC #red
  5. Participant "MainDashPlaylistLoader" as MPL #blue
  6. Participant "mainSegmentLoader" as SL #blue
  7. Participant "AudioDashPlaylistLoader" as APL #green
  8. Participant "audioSegmentLoader" as ASL #green
  9. Participant "external server" as ext #brown
  10. Participant "mpdParser" 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. == Requesting Main Manifest ==
  17. MPL -> MPL : start()
  18. MPL -> ext: xhr request for main manifest
  19. ext -> MPL : response with main manifest
  20. MPL -> parser: parse 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(x)
  26. alt if no sidx
  27. note over MPL #lightgray: zero delay to fake network request
  28. else if sidx
  29. break
  30. MPL -> ext: request sidx
  31. end
  32. end
  33. note over MPL #lightblue: trigger 'loadedmetadata' on main loader [T1]
  34. note over MPL #lightblue: handling 'loadedmetadata'
  35. opt vod and preload !== 'none'
  36. MPL -> SL: playlist()
  37. MPL -> SL: load()
  38. end
  39. == Initializing Media Groups, Choosing Active Tracks ==
  40. MPL -> MG: setupMediaGroups()
  41. MG -> MG: initialize()
  42. == Initializing Alternate Audio Loader ==
  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 -> ASL: reset audio segment loader
  47. == Requesting Alternate Audio Manifest ==
  48. MG -> MG: startLoaders()
  49. MG -> APL: load()
  50. APL -> APL: start()
  51. APL -> APL: zero delay to fake network request
  52. break finish pending tasks
  53. MG -> Tech: add audioTrack
  54. MPL -> PC: setupSourceBuffers_()
  55. MPL -> PC: setupFirstPlay()
  56. loop mainSegmentLoader.monitorBufferTick_()
  57. SL -> ext: requests media segments
  58. ext -> SL: response with media segment bytes
  59. end
  60. end
  61. APL -> APL: zero delay over
  62. APL -> APL: media(x)
  63. alt if no sidx
  64. note over APL #lightgray: zero delay to fake network request
  65. else if sidx
  66. break
  67. MPL -> ext: request sidx
  68. end
  69. end
  70. == Requesting Alternate Audio Segments ==
  71. note over APL #lightblue: trigger 'loadedplaylist'
  72. note over APL #lightblue: handling 'loadedplaylist'
  73. APL -> ASL: playlist()
  74. note over ASL #lightblue: trigger 'loadedmetadata' [T2]
  75. note over APL #lightblue: handling 'loadedmetadata'
  76. APL -> ASL: playlist()
  77. APL -> ASL: load()
  78. loop audioSegmentLoader.monitorBufferTick_()
  79. ASL -> ext: requests media segments
  80. ext -> ASL: response with media segment bytes
  81. end
  82. @enduml