This demo begins with an image that is placed on top of the video screen. When the
user clicks on the image an in-stream clip is played. After the
in-stream clip finishes, the original clip resumes from its original position.
During the time the in-stream clip is played, the image is hidden and the control
bar's timeline is deactivated.
This kind of setup is sometimes referred to as a "mid-roll advertisement". This
time it is done without any advertising plugins and all we need is just the "plain
old" Flowplayer configuration.
We use the content plugin as our
advertisement. The image is set as its background image and we have defined
an onClick handler that will start our in-stream clip.
Note: To play an RTMP clip in-stream with this method a dedicated RTMP
plugin must be added to the plugin configuration with the mandatory
We want our content plugin to be visible again when the in-stream clip ends.
This can be achieved with the onResume event which is triggered for the
parent clip when the in-stream clip finishes. This onResume event is called
for both parent and in-stream clips so we have to differentiate between those
two clips. This can be achieved by checking the isInStream property: