Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save svagionitis/5453579 to your computer and use it in GitHub Desktop.
Save svagionitis/5453579 to your computer and use it in GitHub Desktop.
Diagram For Loading a Video File From Disk (No errors) for http://www.websequencediagrams.com/
# No errors on demux and dcr
title Sequence Diagram For Loading a Video File From Disk (No errors)
participant "Higher Layer (HTML page, JS)" as HigherLayer
participant "Media Player (Webkit {HTMLMediaElement, MediaPlayer, MediaPlayerPrivate}, Irisplayer)" as MediaPlayer
participant "Video pipeline(Local Disk, Demux, Decoder)" as VideoPipeline
HigherLayer->MediaPlayer: load()
note right of MediaPlayer
networkState: NETWORK_EMPTY
readyState: HAVE_NOTHING
end note
note right of MediaPlayer
networkState: NETWORK_NO_SOURCE
end note
MediaPlayer->VideoPipeline: Can you read the media data from the disk?
note right of MediaPlayer
networkState: NETWORK_LOADING
end note
MediaPlayer->HigherLayer: loadstart
MediaPlayer->HigherLayer: progress
note right of VideoPipeline
1. Media Player reads successfuly the file from the hard disk.
2. The decoder decodes the first data in order to get the metadata \nand the first video frames.
end note
VideoPipeline->MediaPlayer: Ok the stream is ready. The metadata is returned. A couple of frames are returned.
note right of MediaPlayer
readyState: HAVE_METADATA
end note
MediaPlayer->HigherLayer: loadedmetadata
note right of MediaPlayer
networkState: NETWORK_IDLE
end note
MediaPlayer->HigherLayer: suspend
note right of MediaPlayer
readyState: HAVE_CURRENT_DATA
end note
MediaPlayer->HigherLayer: loadeddata
MediaPlayer->VideoPipeline: Now that the stream is decoded and have the metatdata, can you send me emough data for playback?
note right of MediaPlayer
networkState: NETWORK_LOADING
end note
MediaPlayer->HigherLayer: progress
note right of VideoPipeline
1. Media Player reads more data from the disk until the buffer is full.
2. Decoder decodes the data to video frames.
end note
VideoPipeline->MediaPlayer: Enough data returned for playback.
note right of MediaPlayer
networkState: NETWORK_IDLE
end note
MediaPlayer->HigherLayer: suspend
note right of MediaPlayer
readyState: HAVE_ENOUGH_DATA
end note
MediaPlayer->HigherLayer: canplay
MediaPlayer->HigherLayer: canplaythrough
HigherLayer->MediaPlayer: play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment