javascript - 如何存储和检索从 Firebase 到应用程序的 URL
问题描述
这是 RTMP 播放器的 URL 链接,但它会定期更改,因此我决定将其存储在 firebase 中并从那里检索它。这是我的代码。我在 firebase 中创建了一个实时数据库。我怎么能在我的应用程序中使用它?
constructor(props) {
super(props);
this.state = {
paused: true
};
}
render() {
return (
<View style={styles.container}>
<ImageBackground
source={require('./backgroundvideo.jpg')}
style={styles.backgroundImage}>
<Video
source={{
uri: "rtmp://187.150.178.26:1245/ntv/live/live1"
}} // Can be a URL or a local file.
ref={ref => {
this.player = ref;
}} // Store reference
controls={true}
volume={1.0}
muted={false}
paused={this.state.paused} // Pauses playback entirely.
resizeMode="cover" // Fill the whole screen at aspect ratio.*
repeat={true} // Repeat forever.
playInBackground={false} // Audio continues to play when app entering background.
progressUpdateInterval={250.0}
style={{ height: height * .35, width: width * 1, backgroundColor: 'black', }}
/>
<Text>Video streaming....</Text>
</ImageBackground>
</View>
);
}
解决方案
推荐阅读
- c++ - 是否可以根据特定的文件扩展名构建任务?
- java - 如何使用 Java Google Drive API 创建文件夹动态和上传多个文件
- vuex - 吸气剂在 vuex 中没有反应
- r - 多列的随机森林算法
- c# - 如何在 Debug > Windows 菜单中添加菜单命令,仅在断点中显示?
- wordpress - 如何在wordpress中显示作者发布的帖子和自定义帖子类型计数
- python - 构建一个使用匹配值更新列的循环?
- npm - 在 gitlab 上 npm install --save 期间找不到 package.json
- javascript - X秒视频JS后显示按钮
- java - 异常,Junit 问题。什么都没扔