We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.contentUri
1 parent c98c4b8 commit 8d51c83Copy full SHA for 8d51c83
lib/src/widget/builder/video_page_builder.dart
@@ -2,6 +2,8 @@
2
/// [Author] Alex (https://github.com/Alex525)
3
/// [Date] 2020/4/6 18:58
4
///
5
+import 'dart:io';
6
+
7
import 'package:flutter/material.dart';
8
import 'package:video_player/video_player.dart';
9
@@ -80,7 +82,11 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
80
82
}
81
83
return;
84
- _controller = VideoPlayerController.contentUri(Uri.parse(url));
85
+ if (Platform.isAndroid) {
86
+ _controller = VideoPlayerController.contentUri(Uri.parse(url));
87
+ } else {
88
+ _controller = VideoPlayerController.network(url);
89
+ }
90
try {
91
await controller.initialize();
92
hasLoaded = true;
0 commit comments