【发布时间】:2018-04-20 20:46:51
【问题描述】:
我正在尝试禁用响应原生视频的搜索功能。我有一个完整的视频,我想预览 30 秒。为了做到这一点,我想禁用搜索按钮,这样用户就不能跳过视频。
我尝试将退出视频播放器的函数值赋予onSeek,但这似乎没有任何作用。
if(!loading) {
return <Video source={{uri: uri}} // Can be a URL or a local file.
onFullscreenPlayerDidDismiss={this.onDismiss}
preferredPeakBitrate={this.state.preferredPeakBitrate}
ref={(player) => {
if(!this.state.playing && player) {
player.presentFullscreenPlayer()
this.setState({ playing: true })
}
}} // Store reference
rate={1.0} // 0 is paused, 1 is normal.
volume={1.0} // 0 is muted, 1 is normal.
muted={false} // Mutes the audio entirely.
paused={false} // Pauses playback entirely.
resizeMode="cover" // Fill the whole screen at aspect ratio.*
repeat={false} // Repeat forever.
playInBackground={true} // Audio continues to play when app entering background.
playWhenInactive={true} // [iOS] Video continues to play when control or notification center are shown.
ignoreSilentSwitch={"ignore"} // [iOS] ignore | obey - When 'ignore', audio will still play with the iOS hard silent switch set to silent. When 'obey', audio will toggle with the switch. When not specified, will inherit audio settings as usual.
progressUpdateInterval={PROGRESS_MILLISECONDS} // [iOS] Interval to fire onProgress (default to ~250ms)
onError={this.onVideoError} // Callback when video cannot be loaded
onProgress={this.onProgress}
onLoadStart={this.onStart}
onEnd={this.stopPlaybackPing}
/>
} else {
return <View />
}
}
【问题讨论】:
-
你想做什么?就像描述更多关于场景,为什么要禁用搜索功能等。很难理解你想要完成什么
-
我已将问题更新为更清晰。我想为用户预览视频并使用相同的完整文件。
-
您是否致电
presentFullscreenPlayer()播放视频? -
是的,我打电话给
presentFullscreenPlayer()
标签: react-native react-native-video