Added onReadyForDisplay to web/dom
This commit is contained in:
parent
e5b5bbee7f
commit
fcef441369
@ -962,8 +962,9 @@ Payload: none
|
||||
|
||||
* iOS: [readyForDisplay](https://developer.apple.com/documentation/avkit/avplayerviewcontroller/1615830-readyfordisplay?language=objc)
|
||||
* Android: [MEDIA_INFO_VIDEO_RENDERING_START](https://developer.android.com/reference/android/media/MediaPlayer#MEDIA_INFO_VIDEO_RENDERING_START)
|
||||
* Android ExoPlayer [STATE_READY](https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/Player.html#STATE_READY)
|
||||
|
||||
Platforms: all
|
||||
Platforms: Android ExoPlayer, Android MediaPlayer, iOS, Web
|
||||
|
||||
#### onPictureInPictureStatusChanged
|
||||
Callback function that is called when picture in picture becomes active or inactive.
|
||||
|
@ -37,6 +37,7 @@ class RCTVideo extends RCTView {
|
||||
this.videoElement = this.initializeVideoElement();
|
||||
this.videoElement.addEventListener("ended", this.onEnd);
|
||||
this.videoElement.addEventListener("loadeddata", this.onLoad);
|
||||
this.videoElement.addEventListener("canplay", this.onReadyForDisplay);
|
||||
this.videoElement.addEventListener("loadstart", this.onLoadStart);
|
||||
this.videoElement.addEventListener("pause", this.onPause);
|
||||
this.videoElement.addEventListener("play", this.onPlay);
|
||||
@ -51,6 +52,7 @@ class RCTVideo extends RCTView {
|
||||
detachFromView(view: UIView) {
|
||||
this.videoElement.removeEventListener("ended", this.onEnd);
|
||||
this.videoElement.removeEventListener("loadeddata", this.onLoad);
|
||||
this.videoElement.removeEventListener("canplay", this.onReadyForDisplay);
|
||||
this.videoElement.removeEventListener("loadstart", this.onLoadStart);
|
||||
this.videoElement.removeEventListener("pause", this.onPause);
|
||||
this.videoElement.removeEventListener("play", this.onPlay);
|
||||
@ -203,6 +205,10 @@ class RCTVideo extends RCTView {
|
||||
this.sendEvent("topVideoLoad", payload);
|
||||
}
|
||||
|
||||
onReadyForDisplay = () => {
|
||||
this.sendEvent("onReadyForDisplay");
|
||||
}
|
||||
|
||||
onLoadStart = () => {
|
||||
const src = this.videoElement.currentSrc;
|
||||
const payload = {
|
||||
|
Loading…
Reference in New Issue
Block a user