react-native - 当expo av本机控件被触发/调用时触发回调?
问题描述
我正在尝试使用 expo-av 在视频中实现 firebase 视频分析:https ://docs.expo.io/versions/latest/sdk/video/
我想要实现的是在调用本机控件时使用回调。eg: play, pause, next/prev 15 secs, 是用原生控件调用的吗?我不太确定要使用什么,我需要知道如何完成它,因为我无法真正看到周围的示例实现。帮助?
解决方案
你可能需要onPlaybackStatusUpdate
道具。
请参阅https://github.com/expo/playlist-example/blob/master/App.js#L510中的示例
<Video
ref={this._mountVideo}
style={[
styles.video,
{
opacity: this.state.showVideo ? 1.0 : 0.0,
width: this.state.videoWidth,
height: this.state.videoHeight
}
]}
resizeMode={Video.RESIZE_MODE_CONTAIN}
onPlaybackStatusUpdate={this._onPlaybackStatusUpdate}
onLoadStart={this._onLoadStart}
onLoad={this._onLoad}
onError={this._onError}
onFullscreenUpdate={this._onFullscreenUpdate}
onReadyForDisplay={this._onReadyForDisplay}
useNativeControls={this.state.useNativeControls}
/>
推荐阅读
- javascript - 使用 boost.asio 向 REST API 服务器发送 POST 请求时出错
- sql - 总结sql中的相邻列
- python -
使用python在XML中组合文本时如何传递元素? - c# - 我们如何在正则表达式下提供方括号
- excel - 在 MS Excel 中使用命名范围
- amazon-dynamodb - DynamoDB如何搜索值列表
- apache-spark - pyspark sqlfunction expr 函数没有按预期工作?
- google-apps-script - 如何跳转到 Google 表格中的特定单元格?
- jquery - Boostrap 验证器检查多个空复选框
- android - 使用 RelativeLayout 将 EditText 与 TextView 对齐