Play butterfly video from asset instead of network (#16269)

This commit is contained in:
Sarah Zakarias
2018-04-05 14:40:56 +02:00
committed by GitHub
parent 2fa8baada6
commit 7010bd416c
2 changed files with 9 additions and 9 deletions

View File

@@ -9,10 +9,7 @@ import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:device_info/device_info.dart';
// TODO(sigurdm): These should not be stored here.
const String butterflyUri =
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4';
// TODO(sigurdm): This should not be stored here.
const String beeUri =
'https://flutter.github.io/assets-for-api-docs/videos/bee.mp4';
@@ -354,10 +351,12 @@ Future<bool> isIOSSimulator() async {
class _VideoDemoState extends State<VideoDemo>
with SingleTickerProviderStateMixin {
final VideoPlayerController butterflyController = new VideoPlayerController(
butterflyUri,
);
final VideoPlayerController beeController = new VideoPlayerController(
final VideoPlayerController butterflyController =
new VideoPlayerController.asset(
'videos/butterfly.mp4',
package: 'flutter_gallery_assets',
);
final VideoPlayerController beeController = new VideoPlayerController.network(
beeUri,
);