-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android平台 player设置不能播放的链接后release会导致anr #87
Comments
How about iOS? |
there no ios device,sorry!
…------------------ 原始邮件 ------------------
发件人: "Caijinglong"<notifications@github.com>;
发送时间: 2019年6月18日(星期二) 下午3:41
收件人: "CaiJingLong/flutter_ijkplayer"<flutter_ijkplayer@noreply.github.com>;
抄送: "侯晓宇"<714411208@qq.com>; "Author"<author@noreply.github.com>;
主题: Re: [CaiJingLong/flutter_ijkplayer] Android平台 player设置不能播放的链接后release会导致anr (#87)
How about iOS?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thx for issue. |
Thx for your plugin!
…------------------ 原始邮件 ------------------
发件人: "Caijinglong"<notifications@github.com>;
发送时间: 2019年6月18日(星期二) 下午3:43
收件人: "CaiJingLong/flutter_ijkplayer"<flutter_ijkplayer@noreply.github.com>;
抄送: "侯晓宇"<714411208@qq.com>; "Author"<author@noreply.github.com>;
主题: Re: [CaiJingLong/flutter_ijkplayer] Android平台 player设置不能播放的链接后release会导致anr (#87)
Thx for issue.
I will fix it in next version.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I can't repeat this crash. flutter_ijkplayer:
git:
url: https://github.com/CaiJingLong/flutter_ijkplayer.git
ref: c016290922c31b91b088ccb692a7636ebd1b91c6 Or, can you publish a minimum code to help me locate the crash. |
I used flutter_ijkplayer: ^0.2.8,not git there the custome widget ,the widget is in a PageView,player release when PageView change page import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_ijkplayer/flutter_ijkplayer.dart';
class VideoView extends StatefulWidget {
final String url;
VideoView(this.url);
@override
_VideoViewState createState() => _VideoViewState();
}
class _VideoViewState extends State<VideoView> with WidgetsBindingObserver{
IjkMediaController controller;
@override
void initState() {
// TODO: implement initState
super.initState();
controller = IjkMediaController();
// controller.setNetworkDataSource(widget.url,autoPlay: true);
// controller.setNetworkDataSource("http://itv.100.ahct.lv1.vcache.cn/100/ott_baseline_kalaok/hd/151/CP0541903573/playlist.m3u8",autoPlay: true);
controller.setNetworkDataSource("http://114.55.36.48/1204/27/index.m3u8",autoPlay: true);
Stream<IjkStatus> ijkStatusStream = controller.ijkStatusStream;
ijkStatusStream.listen((status){
if(status==IjkStatus.complete){
controller?.play();
}
});
// SystemChannels.lifecycle.setMessageHandler((msg) {});
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if(state==AppLifecycleState.resumed){
controller?.play();
}else if(state==AppLifecycleState.paused){
controller?.pause();
}
}
@override
void deactivate() {
// TODO: implement deactivate
super.deactivate();
controller?.pause();
}
@override
void reassemble() {
// TODO: implement reassemble
super.reassemble();
controller?.play();
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
controller?.dispose();
}
@override
Widget build(BuildContext context) {
return IjkPlayer(
mediaController: controller,
controllerWidgetBuilder: (mController)=>new Container(),
);
}
} |
|
I run next code, and I don't meet crash/ANR. import 'package:flutter/material.dart';
import 'package:flutter_ijkplayer/flutter_ijkplayer.dart';
class VideoWidget extends StatefulWidget {
final String url;
VideoWidget(this.url);
@override
_VideoWidgetState createState() => _VideoWidgetState();
}
class _VideoWidgetState extends State<VideoWidget> with WidgetsBindingObserver {
IjkMediaController controller;
@override
void initState() {
super.initState();
controller = IjkMediaController();
controller.setNetworkDataSource(widget.url, autoPlay: true);
Stream<IjkStatus> ijkStatusStream = controller.ijkStatusStream;
ijkStatusStream.listen((status) {
if (status == IjkStatus.complete) {
controller?.play();
}
});
// SystemChannels.lifecycle.setMessageHandler((msg) {});
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
controller?.play();
} else if (state == AppLifecycleState.paused) {
controller?.pause();
}
}
@override
void deactivate() {
super.deactivate();
controller?.pause();
}
@override
void reassemble() {
super.reassemble();
controller?.play();
}
@override
void dispose() {
super.dispose();
controller?.dispose();
}
@override
Widget build(BuildContext context) {
return IjkPlayer(
mediaController: controller,
controllerWidgetBuilder: (mController) => new Container(),
);
}
}
class SreErrorPage extends StatefulWidget {
@override
_SreErrorPageState createState() => _SreErrorPageState();
}
class _SreErrorPageState extends State<SreErrorPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(
child: PageView.builder(
itemBuilder: (BuildContext context, int index) {
return VideoWidget("http://114.55.36.48/1204/27/index$index.m3u8");
},
),
),
);
}
}
|
can the url play?must use the error url. try to replace with this url:
|
OK, the url will crash, I will locate and resolve it. |
ok,thanks |
Before I update the pub version, you can temporarily use git dependencies. There was no crash in this Ref. flutter_ijkplayer:
git:
url: https://github.com/CaiJingLong/flutter_ijkplayer.git
ref: c016290922c31b91b088ccb692a7636ebd1b91c6 |
ok |
I update pub version 0.2.9, and the version fix it. |
你好,这是anr文件的截图
The text was updated successfully, but these errors were encountered: