feat(android): add new events for audioTrack, textTracks and videoTracks

This commit is contained in:
olivier bouillet
2022-08-06 12:05:07 +02:00
parent 62ce3df461
commit 63008ced42
6 changed files with 352 additions and 97 deletions

View File

@@ -116,6 +116,24 @@ export default class Video extends Component {
}
};
_onAudioTracks = (event) => {
if (this.props.onAudioTracks) {
this.props.onAudioTracks(event.nativeEvent);
}
};
_onTextTracks = (event) => {
if (this.props.onTextTracks) {
this.props.onTextTracks(event.nativeEvent);
}
};
_onVideoTracks = (event) => {
if (this.props.onVideoTracks) {
this.props.onVideoTracks(event.nativeEvent);
}
};
_onError = (event) => {
if (this.props.onError) {
this.props.onError(event.nativeEvent);
@@ -316,6 +334,9 @@ export default class Video extends Component {
onVideoLoadStart: this._onLoadStart,
onVideoPlaybackStateChanged: this._onPlaybackStateChanged,
onVideoLoad: this._onLoad,
onAudioTracks: this._onAudioTracks,
onTextTracks: this._onTextTracks,
onVideoTracks: this._onVideoTracks,
onVideoError: this._onError,
onVideoProgress: this._onProgress,
onVideoSeek: this._onSeek,
@@ -495,6 +516,9 @@ Video.propTypes = {
onLoadStart: PropTypes.func,
onPlaybackStateChanged: PropTypes.func,
onLoad: PropTypes.func,
onAudioTracks: PropTypes.func,
onTextTracks: PropTypes.func,
onVideoTracks: PropTypes.func,
onBuffer: PropTypes.func,
onError: PropTypes.func,
onProgress: PropTypes.func,