Using Your Own Player (iOS)
HotMicMediaPlayer allows you to integrate your own player into your application. In order do to this, you must:
- Include the player in your application to be played. (e.g. Bitmovin, JWPlayer, Exo).
- Use our protocol to forward commands to your player when the HotMic protocol dictates (e.g. pause the player).
- Send to HotMic various player events (e.g. notify HotMic the player is paused).
The HMPlayer protocol defines variables and functions you must implement in order to provide a custom player. Your implementation must also store a reference to an HMPlayerDelegate and call its functions to inform the delegate when various events occur.
Provide a view to display on-screen.
Provide the playing status.
Provide the paused status.
Provide the seeking status.
Provide the mute status.
Provide the current audio level as a value between 0 and 100.
Provide the total duration in seconds of the VoD stream or infinity if it’s a live stream.
Provide the current playback position in seconds. For a VoD stream, the time ranges between 0 and the duration of the asset. For a live stream, the time is a Unix timestamp denoting the current playback position.
Provide the current playback rate as a value between 0 and 2.
Store the delegate in a weak optional variable to call its functions in the future.
Turn on volume muted.
Turn off volume muted.
Change the audio level.
Seek to the given playback position for the VoD stream.
Seek by the given time shift offset in seconds from the live edge for the live stream, or seek to the current time plus the given time shift offset for the VoD stream. Return an HMPlayerLiveTimeShiftError if the new time shift is too far behind or ahead of the live position.
Seek the live stream to its 'now' playback time.
Change the playback rate. A value between 0 and 1 enables slow motion and a value between 1 and 2 enables fast forward.
Prepare for device rotation to begin.
Handle device rotation ended.
Prepare to enter fullscreen mode.
Prepare to exit fullscreen mode.
The HMPlayerDelegate protocol defines functions your HMPlayer implementation calls to inform HotMic when various events occur.
Inform the delegate the player invoked play with intention to start/resume playback.
Inform the delegate the player state changed to playing.
Inform the delegate the player state changed to paused.
Inform the delegate the player state changed to buffering.
Inform the delegate the player finished seeking in a live stream by adjusting the time shift.
Inform the delegate the player recovered from a stall due to sufficient buffer.
Inform the delegate the player's playback position changed.
Inform the delegate the player's duration changed.
Inform the delegate the player encountered an error.