# Generate png with: dot -Tpng -O offline.gv

digraph shaka2_offline {
  label=<<u>Shaka 2 Offline Diagram</u>>
  labelloc=t
  node [ shape=rectangle ]
  edge [ fontsize=10 ]

  # Provided by the browser
  HTMLMediaElement [ shape=oval ]
  IndexedDB [ shape=oval ]

  # UI provided by the app
  "App UI" [ shape=polygon ]

  # Plugins
  OfflineScheme [ shape=trapezium ]
  HttpFetchPlugin [ shape=trapezium ]
  OfflineManifestParser [ shape=trapezium ]

  "App UI" -> Storage [ label=".list()\n.store()\n.remove()" ]
  "App UI" -> Player [ label=".load()\n.configure()" ]

  Storage -> Player [ style=dotted, label="config\nfiltering  " ]
  Player -> HTMLMediaElement

  Storage -> DrmEngine
  Storage -> DBEngine

  Player -> NetworkingEngine
  NetworkingEngine -> HttpFetchPlugin [ label="for HTTP URIs" ]
  NetworkingEngine -> OfflineScheme [ label="for offline URIs" ]

  Storage -> DownloadManager
  DownloadManager -> NetworkingEngine [ style=dotted ]

  Player -> OfflineManifestParser

  OfflineManifestParser -> DBEngine [ dir=both label="get manifest" ]
  OfflineScheme -> DBEngine [ dir=both label="get segments" ]
  DownloadManager -> DBEngine [ style=dotted dir=both label="store" ]
  DBEngine -> IndexedDB [ dir=both label="  load/store" ]
}
