fluttercommunity / fluttercommunity/chewie
run in web but can not play the network video
- Dominant language
- Dart
- Stars
- 2.1k
- Forks
- 1.1k
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 6
Description
I find that network video cannot be played by this,is there a way to resolve this problem?Thanks so much
Following is the error in the console of chrome
```
errors.dart:187 Uncaught (in promise) Error: PlatformException(channel-error, Unable to establish connection on channel., null, null)
at Object.throw_ [as throw] (errors.dart:236)
at seekTo (messages.dart:357)
at seekTo.next ()
at async_patch.dart:45
at _RootZone.runUnary (zone.dart:1613)
at _FutureListener.thenAwait.handleValue (future_impl.dart:155)
at handleValueCallback (future_impl.dart:707)
at Function._propagateToListeners (future_impl.dart:736)
at _Future.new.[_completeWithValue] (future_impl.dart:542)
at async._AsyncCallbackEntry.new.callback (future_impl.dart:580)
at Object._microtaskLoop (schedule_microtask.dart:40)
at _startMicrotaskLoop (schedule_microtask.dart:49)
at async_patch.dart:166
```
My page code
````
import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'MyMaterialPage.dart';
class VideoPage extends StatefulWidget {
//https://nico-android-apk.oss-cn-beijing.aliyuncs.com/landscape.mp4
final String playUrl = "https://v-cdn.zjol.com.cn/280443.mp4";
// VideoPage(this.playUrl);
@override
_VideoPageState createState() => _VideoPageState();
}
class _VideoPageState extends State {
VideoPlayerController _videoPlayerController;
ChewieController _chewieController;
@override
void initState() {
super.initState();
_videoPlayerController = VideoPlayerController.network(widget.playUrl);
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
autoPlay: false,
//aspectRatio: 3 / 2.0,
//customControls: CustomControls(),
);
}
@override
void dispose() {
_videoPlayerController.dispose();
_chewieController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MyMaterialPage(
"视频播放demo",
Container(
child: Chewie(controller: _chewieController,),
));
}
}
class MyMaterialPage extends StatelessWidget{
String title;
Widget content;
MyMaterialPage(this.title, this.content);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(title),
),
body: content
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}
````
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.