In each of the following diagrams, blue boxes are used to represent embedder-specific infrastructure, while white boxes are part of the component.
This component supports two types of applications: Web Applications and Streaming Applications. Much of the infrastructure for these two application types is shared, but the differences are substantial enough that each will be discussed independently.
Web Applications are used for hosting the majority of applications for a Cast receiver. At a high level, the flow for using a Web Application is:
ContentBrowserClientMixins
instance in the embedder-specific ContentBrowserClient
implementation, and then use that instance to create a RuntimeApplicationDispatcher
.RuntimeApplicationDispatcher
to create a WebRuntimeApplication
instance, which will then be used to create an instance of the embedder-specific EmbedderApplication
type.Load()
on the RuntimeApplication
instance, and wait for its callback.SetUrlRewriteRules()
on the RuntimeApplication
. This may be called at any time, but is expected to be called at least once before the Launch()
command if such rules are required for the application’s functionality.Launch()
on the RuntimeApplication
instance, and wait for its callback. Various EmbedderApplication
functions will be called to create the necessary resources.StopApplication()
and then destroy the application with the RuntimeApplicationDispatcher
after the StopApplication()
’s callback returns.Streaming Applications are used to support the Cast streaming and remoting scenarios by making use of the cast_streaming
component
ContentBrowserClientMixins
instance in the embedder-specific ContentBrowserClient
implementation, and then use that instance to create a RuntimeApplicationDispatcher
.RuntimeApplicationDispatcher
to create a StreamingRuntimeApplication
instance, which will then be used to create an instance of the embedder-specific EmbedderApplication
type.Load()
on the RuntimeApplication
instance, and wait for its callback.Launch()
on the RuntimeApplication
instance, and wait for its callback. Various EmbedderApplication
functions will be called to create the necessary resources, which will be used to start the cast_streaming
component. Each of the following is expected to occur for the streaming session to successfully begin, but the order may vary:StartPlaybackAsync()
, which will be called as part of the Launch()
command before its callback is called.WebContents
instance associated with this application, as returned by EmbedderApplication::GetWebContents()
, loads the page used for displaying the streaming session.ConfigurationManager
as provided by EmbedderApplication::GetStreamingConfigManager()
.OnStreamingResolutionChanged()
event will be fired.NotifyApplicationStopped()
event will be fired to the EmbedderApplication
, at which point the application should be destroyed by the RuntimeApplicationDispatcher
.