Skip to content

Commit 8d51c83

Browse files
committed
🚑️ Use .contentUri only on Android
1 parent c98c4b8 commit 8d51c83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/src/widget/builder/video_page_builder.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// [Author] Alex (https://github.com/Alex525)
33
/// [Date] 2020/4/6 18:58
44
///
5+
import 'dart:io';
6+
57
import 'package:flutter/material.dart';
68
import 'package:video_player/video_player.dart';
79

@@ -80,7 +82,11 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
8082
}
8183
return;
8284
}
83-
_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+
}
8490
try {
8591
await controller.initialize();
8692
hasLoaded = true;

0 commit comments

Comments
 (0)