Skip to main content

Media Playback

MediaPlayback allows us to control the execution of a media, such as a video. Under the hood MediaPlayback just synchronises start, pause and stop commands of a Clip with the corresponding commands of a media we want to control.

In order to create a custom MediaPlayback you need to extend the MediaPlayback Class of MotorCortex and you can overwrite the following methods:

  • play(milliseconds)
  • stop()
  • onProgress(fraction, milliseconds)

It might seem a bit oxymoron to provide both play/stop and onProgress method. The onProgress method runs only when the user seeks the Clip and not on normal execution.