Skip to main content

Player Callbacks

OnCompletionListener Interface

com.kollus.sdk.media.MediaPlayer.OnCompletionListener

An interface for receiving the playback completion event of content.

Public Methods

  • void onCompletion(MediaPlayer mp)

Method Details

void com.kollus.sdk.media.MediaPlayer.OnCompletionListener.onCompletion(MediaPlayer mp)

Called when playback has completed.

  • Parameters
    • mp: The player instance that completed playback

OnErrorListener Interface

com.kollus.sdk.media.MediaPlayer.OnErrorListener

An interface for receiving error information that occurs during playback.

Public Methods

  • boolean onError(MediaPlayer mp, int what, int extra)

Method Details

boolean com.kollus.sdk.media.MediaPlayer.OnErrorListener.onError(MediaPlayer mp, int what, int extra)

Called when an unexpected error occurs during playback.

  • Parameters
    • mp: The player instance in which the error occurred
    • what: Error code 1
    • extra: Error code 2
  • Return value
    • true: Error handling completed in the application (UI) layer
    • false: Delegates error handling (when false is returned, the SDK internally calls onComplete automatically to terminate the playback session)

OnInfoListener Interface

com.kollus.sdk.media.MediaPlayer.OnInfoListener

An interface for receiving status information (Info) and warning events that occur during playback.

Public Methods

  • void onBufferingEnd(MediaPlayer mp)
  • void onBufferingStart(MediaPlayer mp)
  • void onChangedBandwidth(MediaPlayer mp, BandwidthItem item)
  • void onCodecInitFail(MediaPlayer mp, String componentName)
  • void onDetectBandwidthList(MediaPlayer mp, List<BandwidthItem> list)
  • void onDownloadRate(MediaPlayer mp, int downloadRate)
  • void onFrameDrop(MediaPlayer mp)
  • boolean onInfo(MediaPlayer mp, int what, int extra)

Method Details

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onBufferingEnd(MediaPlayer mp)

Called when data loading is complete and the buffering state is cleared.

  • Parameters
    • mp: The player instance

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onBufferingStart(MediaPlayer mp)

Called when data loading (buffering) starts due to network conditions or other factors.

  • Parameters
    • mp: The player instance

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onChangedBandwidth(MediaPlayer mp, BandwidthItem item)

Called when the bitrate changes during Adaptive Bitrate(ABR) content playback.

  • Parameters
    • mp: The player instance
    • item: Information about the changed bitrate

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onCodecInitFail(MediaPlayer mp, String componentName)

Called when hardware codec initialization fails. (Occurs only for content containing audio watermarks or on devices below Android 4.3 Jelly Bean MR2)

  • Parameters
    • mp: The player instance
    • componentName: The name of the codec that failed to initialize

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onDetectBandwidthList(MediaPlayer mp, List<BandwidthItem>  list)

Called when the full list of bandwidths supported by the service is detected during Adaptive Bitrate(ABR) content playback.

  • Parameters
    • mp: The player instance
    • list: The full list of bandwidth information

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onDownloadRate(MediaPlayer mp, int downloadRate)

Returns the average download transfer speed of a content file when its download is complete.

  • Parameters
    • mp: The player instance
    • downloadRate: Average download speed (bps)

void com.kollus.sdk.media.MediaPlayer.OnInfoListener.onFrameDrop(MediaPlayer mp)

Called when a video frame drop occurs. (Occurs only for content containing audio watermarks or on devices below Android 4.3 Jelly Bean MR2)

  • Parameters
    • mp: The player instance

boolean com.kollus.sdk.media.MediaPlayer.OnInfoListener.onInfo(MediaPlayer mp, int what, int extra)

Called when player status information or an event occurs.

  • Parameters
    • mp: The player instance
    • what: Information type
    • extra: Additional data

OnPreparedListener Interface

com.kollus.sdk.media.MediaPlayer.OnPreparedListener

An interface for receiving the playback preparation complete event.

Public Methods

  • void onPrepared(MediaPlayer mp)

Method Details

void com.kollus.sdk.media.MediaPlayer.OnPreparedListener.onPrepared(MediaPlayer mp)

Called when playback preparation has completed successfully.

  • Parameters
    • mp: The player instance that has completed playback preparation

OnSeekCompleteListener Interface

com.kollus.sdk.media.MediaPlayer.OnSeekCompleteListener

An interface for receiving notification that a seek request has completed.

Public Methods

  • void onSeekComplete(MediaPlayer mp)

Method Details

void com.kollus.sdk.media.MediaPlayer.OnSeekCompleteListener.onSeekComplete(MediaPlayer mp)

Called when a playback position change operation has completed successfully.

  • Parameters
    • mp: The player instance that completed the seek operation

OnVideoSizeChangedListener Interface

com.kollus.sdk.media.MediaPlayer.OnVideoSizeChangedListener

An interface for receiving the initial resolution information of content and notifications when the resolution changes during playback.

Public Methods

  • void onVideoSizeChanged(MediaPlayer mp, int width, int height)

Method Details

void com.kollus.sdk.media.MediaPlayer.OnVideoSizeChangedListener.onVideoSizeChanged(MediaPlayer mp, int width, int height)

Called when the width and height of the video are first identified, or when the resolution changes during playback.

  • Parameters
    • mp: The player instance
    • width: The horizontal resolution of the video
    • height: The vertical resolution of the video

KollusPlayerLMSListener Interface

com.kollus.sdk.media.KollusPlayerLMSListener

An interface for sending the user's playback progress rate to a Learning Management System (LMS) server and receiving the response.

Public Methods

  • void onLMS(String request, String response)

Method Details

void com.kollus.sdk.media.KollusPlayerLMSListener.onLMS(String request, String response)

Triggered when the user's playback progress rate data is sent to the server, and delivers both the sent message and the server's response message.

  • Parameters
    • request: The data message related to playback progress rate sent to the LMS server
    • response: The response message received from the server for the transmission result

KollusPlayerThumbnailListener Interface

com.kollus.sdk.media.KollusPlayerThumbnailListener

An interface for receiving the download and caching status of thumbnail images, which are processed asynchronously in a separate thread when content is loaded.

Public Methods

  • void onCached(int index, int nErrorCode, String savePath)

Method Details

void com.kollus.sdk.media.KollusPlayerThumbnailListener.onCached(int index, int nErrorCode, String savePath)

Receives the download result (success or failure) for each content item when thumbnail downloads are performed in a threaded manner.

  • Parameters
    • index: Identification number (the getUriIndex value of KollusContent)
    • nErrorCode: Error code for the download result (0 indicates success)
    • savePath: The physical path on the local device where the thumbnail is saved