diff --git a/examples/basic/src/VideoPlayer.android.tsx b/examples/basic/src/VideoPlayer.android.tsx index 0ca36fb6..ef53c752 100644 --- a/examples/basic/src/VideoPlayer.android.tsx +++ b/examples/basic/src/VideoPlayer.android.tsx @@ -16,7 +16,7 @@ import { import { Picker } from '@react-native-picker/picker' -import Video, { TextTrackType } from 'react-native-video'; +import Video, { VideoDecoderProperties, TextTrackType } from 'react-native-video'; class VideoPlayer extends Component { @@ -77,6 +77,28 @@ class VideoPlayer extends Component { video: Video; seekPanResponder: PanResponder | undefined; + popupInfo = () => { + VideoDecoderProperties.getWidevineLevel().then((widevineLevel: number) => { + VideoDecoderProperties.isHEVCSupported().then((hevcSupported: boolean) => { + VideoDecoderProperties.isCodecSupported('video/avc', 1920, 1080).then( + (avcSupported: boolean) => { + this.toast( + true, + 'Widevine level: ' + + widevineLevel + + '\n hevc: ' + + (hevcSupported ? '' : 'NOT') + + 'supported' + + '\n avc: ' + + (avcSupported ? '' : 'NOT') + + 'supported', + ) + }, + ) + }) + }) + } + onLoad = (data: any) => { this.setState({ duration: data.duration, loading: false, }); this.onAudioTracks(data.audioTracks) @@ -288,6 +310,18 @@ class VideoPlayer extends Component { ) } + renderInfoControl() { + return ( + { + this.popupInfo() + }} + > + {'decoderInfo'} + + ) + } + renderFullScreenControl() { return ( + + {this.renderInfoControl()} + {this.renderPause()} {this.renderRepeatModeControl()}