Player Events Reference
Exposed events from LuraPlayer component are explained in this section.
import { useRef } from 'react';
import LuraPlayer from 'lura-react-native-core';
export default function MySampleComponent(){
const playerRef = useRef<LuraPlayer>(null);
const config = {
token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg"
};
...
function onPlayingStartHandler(){
...
}
...
return (
<View>
<LuraPlayer
ref={playerRef}
config={config}
onPlayingStart={onPlayingStartHandler}
/>
</View>
);
}
| Event | Source | Description |
|---|---|---|
| onStreamInitialized | Custom | Event fired when the video stream is initialized |
| onManifestLoaded | Custom | Event fired when the video manifest has been loaded |
| onNativeTimeUpdate | Custom | Event fired when the time of the video has been updated |
| onPreviewMatrixLoaded | Custom | Event fired when the preview matrix of the video is loaded |
| onCaptionSelected | Custom | Event fired when a caption is selected in the video player |
| onCaptionAttached | Custom | Event fired when a caption is attached to the video player |
| onCaptionCueChanged | Custom | Event fired when a caption cue is changed in the video player |
| onCaptionLoadFailed | Custom | Event fired when a caption load fails in the video player |
| onAudioTracksUpdated | Custom | Event fired when the audio tracks of the video have been updated |
| onAudioTrackLoaded | Custom | Event fired when an audio track of the video has been loaded |
| onAudioTrackSwitched | Custom | Event fired when an audio track of the video is switched |
| onAudioTrackSwitching | Custom | Event fired when an audio track of the video is switching |
| onAudioTrackSelected | Custom | Event fired when an audio track of the video is selected |
| onMutedAutoplayForced | Custom | Event fired when the video player is forced to mute |
| onInterstitialFired | Custom | Event fired when an interstitial is fired in the video player |
| onVideoMetadataUpdated | Custom | Event fired when the video metadata is updated |
| onTimedMetadata | Custom | Event fired when timed metadata is available in the video |
| onDashTimedMetadata | Custom | Event fired when timed metadata is available in the video using DASH protocol |
| onCastingRequested | Custom | Event fired when casting is requested in the video player |
| onCastingStarted | Custom | Event fired when casting is started in the video player |
| onCastingEnded | Custom | Event fired when casting is ended in the video player |
| onLoad | HTML5 | Event fired when the video content has been loaded |
| onAudioProcess | HTML5 | Event fired when the video audio processing is done |
| onCanPlay | HTML5 | Event fired when the video is able to be played |
| onCanPlayThrough | HTML5 | Event fired when the video is able to be played without buffering |
| onComplete | HTML5 | Event fired when the video has completed playback |
| onDurationChange | HTML5 | Event fired when the video duration has changed |
| onEmptied | HTML5 | Event fired when the video source has been emptied |
| onEnded | HTML5 | Event fired when the video playback has ended |
| onLoadedData | HTML5 | Event fired when the video data has been loaded |
| onLoadedMetadata | HTML5 | Event fired when the video metadata is loaded |
| onPause | HTML5 | Event fired when the video is paused by the user or programmatically |
| onPlay | HTML5 | Event fired when the video begins to play |
| onPlaying | HTML5 | Event fired when the video is playing |
| onProgress | HTML5 | Event fired as the video's download progresses |
| onRateChange | HTML5 | Event fired when the video's playback rate changes |
| onSeeking | HTML5 | Event fired when seeking begins |
| onStalled | HTML5 | Event fired when the browser is unable to fetch media data, but is still trying |
| onSuspend | HTML5 | Event fired when loading of media data is suspended |
| onTimeUpdate | HTML5 | Event fired when the current time of the video changes |
| onVolumeChange | HTML5 | Event fired when the volume of the video changes |
| onWaiting | HTML5 | Event fired when the video stops because of a buffer underrun |
| onCueAdded | Custom | Event fired when a new text track cue is added to the video |
| onCueEnter | Custom | Event fired when the playhead enters a text track cue in the video |
| onCueExit | Custom | Event fired when the playhead exits a text track cue in the video |
| onCueUpdated | Custom | Event fired when a text track cue is updated in the video |
| onPlayRequested | Custom | Event fired when the user requests the video to play |
| onPauseRequested | Custom | Event fired when the user requests the video to pause |
| onAdBreaksReady | Custom | Event fired when ad breaks have been loaded and are ready to play in the video |
| onAdImpression | Custom | Event fired when an ad begins to play in the video |
| onAdBreakStarted | Custom | Event fired when an ad break begins to play in the video |
| onAdStarted | Custom | Event fired when an individual ad begins to play in the video |
| onAdStopped | Custom | Event fired when an individual ad stops playing in the video |
| onAdSkipStateChanged | Custom | Event fired when the skip state of an ad changes (e.g. skip button appears or disappears) |
| onAdClicked | Custom | Event fired when the user clicks on an ad in the video |
| onAdCompleted | Custom | Event fired when an individual ad has completed playing in the video |
| onAdFirstQuartile | Custom | Event fired when an ad has reached the first quarter of its playtime |
| onAdMidpoint | Custom | Event fired when an ad has reached its midpoint |
| onAdMetadata | Custom | Event fired when ad metadata is loaded and available for use |
| onAdMuted | Custom | Event fired when an ad is muted by the user or programmatically |
| onAdUnmute | Custom | Event fired when an ad is unmuted by the user or programmatically |
| onAdPaused | Custom | Event fired when an ad is paused by the user or programmatically |
| onAdProgress | Custom | Event fired when the progress of an ad changes |
| onAdResumed | Custom | Event fired when an ad is resumed by the user or programmatically |
| onAdSkipped | Custom | Event fired when an ad is skipped by the user |
| onAdThirdQuartile | Custom | Event fired when an ad has reached the third quarter of its playtime |
| onAdVolumeChanged | Custom | Event fired when the volume of an advertisement changes |
| onAdBreakCompleted | Custom | Event fired when an advertisement break is completed |
| onAdTimeUpdate | Custom | Event fired when the time updates in an advertisement |
| onAdBufferEnd | Custom | Event fired when an advertisement buffer has ended |
| onAdExternalStart | Custom | Event fired when an external advertisement is started |
| onAdExternalEnd | Custom | Event fired when an external advertisement is ended |