befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 354 forks source link

[BUG]引入fijkplayer插件后IOS启动APP会自动暂停其他声音 #401

Open jialongsu opened 3 years ago

jialongsu commented 3 years ago

Describe the bug flutter APP 引入fijkplayer插件,当打开app的时候回自动暂停其它后台播放的音频APP

fijkplayer version fijkplayer: ^0.8.8

Smartphone (please complete the following information): 什么手机设备和系统版本?

Additional context flutter版本为1.22.4 Dart版本为2.10.4

我有在已关闭的issues中有过此类问题#219,但是在fijkplayer: ^0.8.8上并没有生效

befovy commented 3 years ago

如果进程双击被杀启动APP确实已经修复了。但,启动APP后,进入播放视屏的界面,再次退出视屏播放进入首页,视频资源释放了 player?.release();player?.dispose();,再次按Home进入后台,播放三方声音,启动APP(还在内存中),声音依然会被暂停。

Originally posted by @pan365wang in https://github.com/befovy/fijkplayer/issues/219#issuecomment-622314619

复现步骤是这样吗?

jialongsu commented 3 years ago

复现步骤: 1.启动网易云或者QQ音乐并播放音频 2.直接启动或从后台呼起集成了fijkplayer的App,跳转到使用FijkPlayer的Api的界面 3.正在后台播放的音频被自动暂停了

befovy commented 3 years ago

调用了 fijkplayer 的什么 api 呢

jialongsu commented 3 years ago

` import 'package:fijkplayer/fijkplayer.dart'; import 'package:flutter/material.dart';

class VideoScreen extends StatefulWidget { final String url;

VideoScreen({@required this.url});

@override _VideoScreenState createState() => _VideoScreenState(); }

class _VideoScreenState extends State { final FijkPlayer player = FijkPlayer();

_VideoScreenState();

@override void initState() { super.initState(); initPlay(); }

initPlay() async { FijkLog.setLevel(FijkLogLevel.Error); FijkOption option = FijkOption(); option.setPlayerOption('enable-accurate-seek', 1); option.setHostOption('request-screen-on', 1); //播放时屏幕常亮 await player.applyOptions(option); await player.setDataSource(widget.url); }

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Fijkplayer Example")), body: Container( alignment: Alignment.center, child: FijkView( player: player, ), )); }

@override void dispose() { super.dispose(); player.release(); } }

` 在后台呼起APP至前台时,这里的API都没有调用,但是我看打出一个日志:IJKFFMediaPlayer:audioSessionInterrupt: end 在这个日志打印后,其它正在后台播放的音频被暂停了