Skip to main content

didStopPlayingClip

Notifies the SDK that the key play clip at the specified index stopped playing.

Overview

Call this method when your video player stops playing a key play clip. This can occur when the clip finishes, the user stops playback, or playback is interrupted. The SDK will update its UI to reflect that the clip is no longer playing.

Syntax

abstract fun didStopPlayingClip(index: Int)

Parameters

ParameterTypeDescription
indexIntThe index of the clip that stopped playing

Example

// When clip playback stops
fun onClipStopped(clipIndex: Int) {
viewModel.didStopPlayingClip(clipIndex)
}

// In a video player callback
videoPlayer.setOnPlaybackStopListener { clip ->
val index = getClipIndex(clip)
viewModel.didStopPlayingClip(index)
}

// When user manually stops playback
fun stopCurrentClip() {
val currentIndex = getCurrentClipIndex()
videoPlayer.stop()
viewModel.didStopPlayingClip(currentIndex)
}

// When clip finishes naturally
videoPlayer.setOnCompletionListener { clip ->
val index = getClipIndex(clip)
viewModel.didStopPlayingClip(index)
}

Notes

  • Call this method when clip playback ends for any reason
  • The SDK will update UI to show the clip is no longer playing
  • Also call this when switching to a different clip
  • Pair this with didStartPlayingClip() when playback starts