如何在颤动中播放网络视频

时间:2020-09-11 16:19:06

标签: flutter dart flutter-video-player

我正在尝试将来自另一个站点的网络视频放入Flutter。

我使用了 video_player 软件包。我使用了将来的构建器,其中import pandas as pd from matplotlib import pyplot as plt import seaborn as sns data = {'date': ['January 2020', 'February 2020', 'March 2020', 'April 2020', 'May 2020'], 'revenue': [29000,31000,32000,25000,34000]} df = pd.DataFrame(data) df["date"] = pd.to_datetime(df["date"]) plt.figure(figsize=(14,5)) sns.set() ax = sns.barplot(data=df, x="date", y="revenue", ci=None) ax.set_xticklabels(df['date'].dt.strftime('%Y-%m')) plt.xticks(rotation=45) plt.show() 将一直运行直到加载视频为止。当我运行该应用程序时,开始时CircularProgressIndicator会继续运行,并在几秒钟后停止播放,就好像加载了视频一样,但是在模拟器上显示为完全空白。换句话说,视频无法加载。

启动应用后

enter image description here

加载后

enter image description here

这是代码

CircularProgressIndicator

1 个答案:

答案 0 :(得分:0)

您的视频链接不是有效的视频链接,它是嵌入的网址。

要通过网络URL播放视频,请使用直接视频URL,例如https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4

将此链接放在videoController中,它将正常工作。

相关问题