A Flutter media player plugin for iOS and android based on ijkplayer

Overview

fijkplayer (Video player plugin for Flutter) Flutter 媒体播放器

手把手带你写 Flutter 系统音量插件 Flutter 多版本管理工具 fvm

HitCount     pub package     Action Status    

A Flutter media player plugin for iOS and android based on ijkplayer

您的支持是我们开发的动力。 欢迎Star,欢迎PR~。 Feedback welcome and Pull Requests are most welcome!

Documentation 文档

Installation 安装

Add fijkplayer as a dependency in your pubspec.yaml file.

pub package

dependencies:
  fijkplayer: ^{{latest version}}

Replace {{latest version}} with the version number in badge above.

Use git branch which not published to pub.

dependencies:
  fijkplayer:
    git:
      url: https://github.com/befovy/fijkplayer.git
      ref: develop # can be replaced to branch or tag name

Example 示例

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<VideoScreen> {
  final FijkPlayer player = FijkPlayer();

  _VideoScreenState();

  @override
  void initState() {
    super.initState();
    player.setDataSource(widget.url, autoPlay: true);
  }

  @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();
  }
}

Contributors 贡献者

Thanks goes to these wonderful people (emoji key)

This project follows the all-contributors specification. Contributions of any kind welcome

iOS Warning 警告

Warning: The fijkplayer video player plugin is not functional on iOS simulators. An iOS device must be used during development/testing. For more details, please refer to this issue.

Join Ding Talk Group 加入钉钉群

加入钉钉群 微信赞赏码 支付宝
加入钉钉群 微信赞赏码 支付宝二维码
Comments
  • ListView里使用它

    ListView里使用它

    我在PageView+ListView的环境下使用FijkPlayer 我当时是有2种思路 1.一个 PageView持有一个Player 对象 2.ListView中Item单独持有一个Player对象(多了会直接闪退) 但是在构建列表视频中还是碰到了各种问题 想问下作者,看看能不能出一个ListView使用的demo,

    opened by JamesGZM 19
  • 在mac上进行pod install时报错  No such file or directory fijkplayer.podspec.json

    在mac上进行pod install时报错 No such file or directory fijkplayer.podspec.json

    报错信息如下 The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/apple/code/IH_MT/IH_MT/ios/Pods/FIJKPlayer/IJKPlayer.framework) 然后看了一下别人的解决方案 在spec文档中添加s.static_framework=true时 报了另外一个错误 no file found Fijkplayer. json 我使用的版本是0.1.4

    CocoaPods 
    opened by byerman 16
  • 部分视频无法播放

    部分视频无法播放

    http://jiasu-33.ivneu.cn/20190702/%E5%88%9D%E6%81%8B%E6%9C%AA%E6%BB%A1/2000kb/hls/index.m3u8

    控制台显示如下: I/IJKMEDIA(15880): SDL_JNI_DetachThreadEnv: [16315] D/IJKMEDIA(15880): FFP_MSG_ERROR: -1094995529 E/tv.danmaku.ijk.media.player.IjkMediaPlayer(15880): Error (-1094995529,0,Invalid data found when processing input) I/flutter (15880): errorListerner: PlatformException(-1094995529, Invalid data found when processing input, 0), FijkException(-1094995529, Invalid data found when processing input) I/flutter (15880): state_change: new: FijkState.error <= old: FijkState.asyncPreparing

    opened by iperfectapp 16
  • [BUG]在mac下调试错误

    [BUG]在mac下调试错误

    MacBook-Air:ios$ pod install Analyzing dependencies Fetching podspec for Flutter from .symlinks/flutter/ios Fetching podspec for fijkplayer from .symlinks/plugins/fijkplayer/ios Downloading dependencies Installing FIJKPlayer (0.3.5)

    一直卡在这里

    bug wait confirm 
    opened by iperfectapp 15
  • 视频截图功能

    视频截图功能

    现在网上关于Flutter 屏幕截图全都是采用 RepaintBoundary 来包裹Widget实现,但是FijkPlayer并不是一个Widget, 我在操作用这种方式截屏的时候,只能截取到我自定义的播放器UI的图,视频的播放内容截取不到,目前有没有什么其他的方法可以实现视频截图,如果你后面要实现视频截图功能,你大概会怎么做,可以给点意见吗

    opened by HQiang 14
  • [BUG]0.8.7版本ios arm64库缺失

    [BUG]0.8.7版本ios arm64库缺失

    Describe the bug A clear and concise description of what the bug is. 使用你的demo把地址改成远程的0.8.7 如下: fijkplayer: ^0.8.7 # path: ../

    What attempts have you made to resolve this error ? 使用0.8.3 并把ios pod依赖的BIJKPlayer强制依赖成0.7.3 没有播放问题

    Expected behavior A clear and concise description of what you expected to happen. 描述清楚你希望的运行结果是什么

    Screenshots If applicable, add screenshots to help explain your problem. ios依赖的BIJKPlayer0.7.8缺少某个arm64的库,日志如下 Undefined symbols for architecture arm64: "___darwin_check_fd_set_overflow", referenced from: _RAND_poll in IJKMediaPlayer(rand_unix.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) note: Using new build system note: Planning build note: Constructing build description

    Smartphone (please complete the following information): 什么手机设备和系统版本? 编译报错,所有版本 Xcode Version 11.2.1 (11B500)

    opened by didiao11300 13
  • iOS 环境无法兼容 Flutter_ffmpeg 插件[BUG]

    iOS 环境无法兼容 Flutter_ffmpeg 插件[BUG]

    Describe the bug A clear and concise description of what the bug is. iOS 环境下,同时引用 Flutter_ffmpeg 与 ijkplayer 将无法播放视频,页面直接卡死,没有闪退。

    What attempts have you made to resolve this error ? 为了解决这个问题你有什么尝试? 尝试删除 Flutter_ffmpeg 组件,则代码正常运行

    To Reproduce 问题的复现步骤 Steps to reproduce the behavior:

    1. pubspec.yaml 添加 flutter_ffmpeg: 0.2.10fijkplayer: 0.8.4
    2. 执行 flutter run
    3. 进入视频播放页后,界面直接卡死,无法进行任何操作。
    4. 报错如下:
    ff_read (39): EXC_BAD_ACCESS (code=1, address=0x0)
    

    Expected behavior A clear and concise description of what you expected to happen.

    希望能够正常播放视频,或者能够提供 flutter_ffmpegexecute 功能,例如:

    final _ffmpeg = FlutterFFmpeg();
    final result = await _ffmpeg.execute(
       '-ss $cropVideoStartTime -t $videoDuration -accurate_seek -i '
       '$path -codec copy -avoid_negative_ts 1 $generatedPath'
    );
    

    使用 ijkplayer 的视频 app 开发者大概率有裁剪视频、上传视频的需求,目前裁剪视频也只能使用 flutter_ffmpege,所以希望大佬能够修复此问题。

    Screenshots If applicable, add screenshots to help explain your problem. iOS 报错截图如下:

    ios_error

    fijkplayer version Which version you used. 0.8.4

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

    • Device: [e.g. iPhone6S]
    • OS: [e.g. iOS13.5]

    Additional context Add any other context about the problem here.

    flutter doctor:

    flutter_doctor

    ffmpeg 
    opened by SpanishOnion 11
  • [BUG]偶现bug,没有画面,日志无报错,对比正常显示的少了一条日志

    [BUG]偶现bug,没有画面,日志无报错,对比正常显示的少了一条日志

    Describe the bug 页面黑屏,不显示页面,无报错,通过看输出日志,对比正常可以播放的输出日志发现少了一条输出不确定每次都会出现,但是几率在40%,

    先看正常的输出 image

    正常的话在最后四条输出中会有一个 video rendering stared的输出 不展示画面的日志如下 image

    看到少了一个 video rendering stared 的输出。

    To Reproduce 不确定哪次会复现,但是几率在30%, 如果退出播放页面,再进入,多试几次就又可以了

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    fijkplayer version Which version you used.

    Smartphone (please complete the following information):

    • Device: iphoneX
    • OS: ios12.4
    • flutter:1.7.8-hotfix4
    opened by fantasy525 11
  • [BUG]iOS不能https://dl.bintray.com/befovytray/bijkplayer/f0.7.8/IJKMediaPlayer.tar.gz访问这个导致编译失败

    [BUG]iOS不能https://dl.bintray.com/befovytray/bijkplayer/f0.7.8/IJKMediaPlayer.tar.gz访问这个导致编译失败

    Downloading dependencies

    -> Installing BIJKPlayer (0.7.8)
     > Http download
       $ /usr/bin/curl -f -L -o /var/folders/3v/d9f98q095rj322r9s4z_t47m0000gn/T/d20210508-21902-168uk9r/file.tgz https://dl.bintray.com/befovytray/bijkplayer/f0.7.8/IJKMediaPlayer.tar.gz --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.1 cocoapods-downloader/1.4.0'
    
    [!] Error installing BIJKPlayer
    [!] /usr/bin/curl -f -L -o /var/folders/3v/d9f98q095rj322r9s4z_t47m0000gn/T/d20210508-21902-168uk9r/file.tgz https://dl.bintray.com/befovytray/bijkplayer/f0.7.8/IJKMediaPlayer.tar.gz --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.1 cocoapods-downloader/1.4.0'
    
    opened by panmili 10
  • The plugin freezes after a few seconds [BUG]

    The plugin freezes after a few seconds [BUG]

    Describe the bug I am using this code in your example      player.setDataSource ("rtsp: //186.136.138.167: 44244", autoPlay: true);      player.setOption (FijkOption.formatCategory, "rtsp_transport", "tcp");

    The console print me this.

    I/flutter ( 1298): [inf] 2020-01-09 11:53:51.336004 [fijk] create player id:6 I/flutter ( 1298): [inf] 2020-01-09 11:53:51.338267 [fijk] FijkPlayer{id:6} invoke setDataSource rtsp://186.136.138.167:44244 I/flutter ( 1298): [inf] 2020-01-09 11:53:51.338918 [fijk] FijkPlayer{id:6} setOption k:rtsp_transport, v:tcp I/flutter ( 1298): [inf] 2020-01-09 11:53:51.340674 [fijk] FijkPlayer{id:6} state changed to FijkState.initialized <= FijkState.idle I/flutter ( 1298): [inf] 2020-01-09 11:53:51.343043 [fijk] FijkPlayer{id:6} invoke prepareAsync and start #1 I/flutter ( 1298): [inf] 2020-01-09 11:53:51.343316 [fijk] FijkPlayer{id:6} setOption k:start-on-prepared, v:1 I/flutter ( 1298): [inf] 2020-01-09 11:53:51.348343 [fijk] FijkPlayer{id:6} state changed to FijkState.asyncPreparing <= FijkState.initialized I/flutter ( 1298): [inf] 2020-01-09 11:53:51.349105 [fijk] FijkPlayer{id:6} invoke prepareAsync and start #1 -> done I/flutter ( 1298): [inf] 2020-01-09 11:53:51.349746 [fijk] FijkPlayer{id:6} state changed to FijkState.initialized <= FijkState.idle I/flutter ( 1298): [inf] 2020-01-09 11:53:51.350547 [fijk] FijkPlayer{id:6} state changed to FijkState.asyncPreparing <= FijkState.initialized I/flutter ( 1298): [inf] 2020-01-09 11:53:59.514300 [fijk] FijkPlayer{id:6} rotate degree 0 I/flutter ( 1298): [inf] 2020-01-09 11:53:59.515261 [fijk] FijkPlayer{id:6} size changed (640, 480) I/flutter ( 1298): [inf] 2020-01-09 11:53:59.517517 [fijk] FijkPlayer{id:6} prepared duration 0:00:00.000000 I/flutter ( 1298): [inf] 2020-01-09 11:53:59.517832 [fijk] FijkPlayer{id:6} setupSurface I/flutter ( 1298): [inf] 2020-01-09 11:53:59.518809 [fijk] FijkPlayer{id:6} state changed to FijkState.prepared <= FijkState.asyncPreparing I/flutter ( 1298): [inf] 2020-01-09 11:53:59.519490 [fijk] FijkPlayer{id:6} setupSurface I/flutter ( 1298): [inf] 2020-01-09 11:53:59.520310 [fijk] FijkPlayer{id:6} state changed to FijkState.started <= FijkState.prepared I/flutter ( 1298): [inf] 2020-01-09 11:53:59.520880 [fijk] FijkPlayer{id:6} setupSurface I/flutter ( 1298): [inf] 2020-01-09 11:53:59.557526 [fijk] view setup, vid:5 I/flutter ( 1298): [inf] 2020-01-09 11:53:59.558334 [fijk] view setup, vid:5 I/flutter ( 1298): [inf] 2020-01-09 11:53:59.558691 [fijk] view setup, vid:5 I/flutter ( 1298): [inf] 2020-01-09 11:53:59.559298 [fijk] FijkPlayer{id:6} size changed (640, 480) I/flutter ( 1298): [inf] 2020-01-09 11:53:59.559888 [fijk] FijkPlayer{id:6} size changed (640, 480) I/flutter ( 1298): [inf] 2020-01-09 11:53:59.560738 [fijk] FijkPlayer{id:6} size changed (640, 480) I/flutter ( 1298): [inf] 2020-01-09 11:53:59.561547 [fijk] FijkPlayer{id:6} video rendering started

    can you help me?

    opened by xpektroMX 10
  • [BUG]出现一次默认控制器 Slider 错误

    [BUG]出现一次默认控制器 Slider 错误

    Flutter 1.91 sdk 版本 0.1.0 为了实现自动播放下一集目前我这边的做法是监听播放器状态 completed 然后 reSet 和 setDataSource(), 测试中出现一次 Slider 溢出错误, 在播放到最后一秒的时候 错误信息: "package:flutter/src/material/slider.dart':Failed assertion: line 132 pos 15: 'value >= min && value <= max':is not true

    另外测试多个视频发现没有调用 completed, 播放时长也会在离总时长差 1 秒时停住, 播放源为 .m3u8

    wait confirm 
    opened by ZeroJian 10
  • Change aspect ratio video at runtime

    Change aspect ratio video at runtime

    I have FijkPlayer and FijkView

    FijkView( player: player, fit: FijkFit.cover, panelBuilder: (player, data, context, viewSize, texturePos) => customFijkPanelBuilder( player, data, context, viewSize, texturePos), ),

    when playing video, user could change the ratio with player:

    player.setFit(FijkFit.cover) or something like that.

    opened by winterdl 0
  • [BUG] 带tabbar的时候点击全屏tabbar不会消失

    [BUG] 带tabbar的时候点击全屏tabbar不会消失

    Describe the bug 带tabbar的时候点击全屏tabbar不会消失(视频是横向视频)

    What attempts have you made to resolve this error ? 为了解决这个问题你有什么尝试? 有问题请自己先努力尝试解决。 尤其是一些已经在错误输出中给出了可能的解决办法的问题

    To Reproduce 问题的复现步骤

    1. 设置 tabbar
    2. 点击视频的全屏

    Expected behavior tabbar 消失,视频能全屏播放

    Screenshots If applicable, add screenshots to help explain your problem. 如果截图有助于对此问题的理解,一定要附上截图

    fijkplayer version 最新版本

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

    opened by lyb5834 1
  • 报错:mpjni: setOption: null mp

    报错:mpjni: setOption: null mp

    java.lang.IllegalStateException: mpjni: setOption: null mp
    	at tv.danmaku.ijk.media.player.IjkMediaPlayer._setOption(Native Method)
    	at tv.danmaku.ijk.media.player.IjkMediaPlayer.setOption(IjkMediaPlayer.java:990)
    	at com.befovy.fijkplayer.FijkPlayer.setup(FijkPlayer.java:137)
    	at com.befovy.fijkplayer.FijkPlayer.onMethodCall(FijkPlayer.java:442)
    	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
    	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
    	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:319)
    	at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
    	at android.os.Handler.handleCallback(Handler.java:938)
    	at android.os.Handler.dispatchMessage(Handler.java:99)
    	at android.os.Looper.loopOnce(Looper.java:211)
    	at android.os.Looper.loop(Looper.java:300)
    	at android.app.ActivityThread.main(ActivityThread.java:8237)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1046)
    

    每次启动的时候都会提示这个报错?

    opened by Aaron009 0
  • fijkplayer 是否可以缓存视频呢?

    fijkplayer 是否可以缓存视频呢?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by yjt1216 1
  • How to hide media controller?

    How to hide media controller?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by halotitan 1
Releases(v0.9.0)
  • v0.9.0(May 30, 2021)

  • v0.1.5(Sep 25, 2019)

    • ios: fix NSUrl parse error
    • fijkplayer: add FijkLog with levels
    • docs: english translation
    • fijkplayer: new feature fijkvolume, system volume API
    • ijkplayer: set default option start-on-prepated to 0
    • iOS: fix CocoaPods use_frameworks! error

    New Contributor @NewYorkFive 👏🎉

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Aug 25, 2019)

    • Almost ijkplayer api supported.
    • Stable API
    • Specification errors and exception handling
    • Easy to use, with native ffmpeg and ijkplayer pre build
    • Good documents. http://fijkplayer.befovy.com
    Source code(tar.gz)
    Source code(zip)
YoYo Video Player is a HLS(.m3u8) video player for flutter.

YoYo Video Player YoYo Video Player is a HLS(.m3u8) video player for flutter. The video_player is a video player that allows you to select HLS video s

Ko Htut 89 Dec 23, 2022
Flutter-Music-Player - A simple music player app that let you play mp3 songs with some customization feature with a rich user interface

Flutter-Music-Player - A simple music player app that let you play mp3 songs with some customization feature with a rich user interface

Ashirbad Swain 6 Jan 4, 2023
Just_audio: a feature-rich audio player for Android, iOS, macOS and web

just_audio just_audio is a feature-rich audio player for Android, iOS, macOS and web. Mixing and matching audio plugins The flutter plugin ecosystem c

Ensar Yusuf Yılmaz 2 Jun 28, 2022
Tiwee - An IPTV player developed for android/ios devices with flutter

Tiwee An IPTV player developed for android/ios devices with flutter you can watc

Hossein 58 Dec 27, 2022
Advanced video player based on video_player and Chewie for flutter

Better Player Advanced video player based on video_player and Chewie. It's solves many typical use cases and it's easy to run. Introduction This plugi

Ahmed Mahmoud 1 Dec 22, 2021
A flutter based music player for subsonic compatible music servers.

subsound A subsonic music player. Screenshots Release todo fix random breakage of player sometimes. seems like onStart is not working after background

Eivind Siqveland Larsen 26 Oct 6, 2022
ScrollGalleryView is a flexible library which helps you to create awesome media galleries in your Android application.

ScrollGalleryView ScrollGalleryView is a flexible library which helps you to create awesome media galleries in your Android application. It's easily i

Boris Korogvich 529 Nov 30, 2022
Flutter plugin for sound. Audio recorder and player.

Flutter Sound user: your documentation is there The CHANGELOG file is here Overview Flutter Sound is a Flutter package allowing you to play and record

null 764 Jan 2, 2023
Flutter plugin for sound. Audio recorder and player.

Sounds Sounds is a Flutter package allowing you to play and record audio for both the android and ios platforms. Sounds provides both a high level API

Brett Sutton 75 Dec 8, 2022
Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API.

Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. The package exposes almost all the API provided by iFrame Player API. So, it's 100% customizable.

Sarbagya Dhaubanjar 558 Jan 2, 2023
A opensource, minimal and powerful audio player for android

A opensource, minimal and powerful audio player for android

Milad 7 Nov 2, 2022
Minimalistic local music player built with flutter for android.

Nano Music Player Simple local music player built with flutter. It uses the audioplayer plugin to play files, and path_provider to locate the external

Jan Hrastnik 34 Dec 17, 2022
Flutter plugin for selecting multiple images from the Android and iOS image library

Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotating, cropping, adding sticker/filters.

Weta Vietnam 91 Dec 19, 2022
A Flutter audio plugin (Swift/Java) to play remote or local audio files on iOS / Android / MacOS and Web

AudioPlayer A Flutter audio plugin (Swift/Java) to play remote or local audio files on iOS / Android / MacOS and Web. Online demo Features Android / i

Erick Ghaumez 489 Dec 18, 2022
A flutter plugin to handle Android / iOS camera

?? Overview Flutter plugin to add Camera support inside your project. CamerAwesome include a lot of useful features like: ?? Live camera flip ( switch

Apparence.io 511 Jan 5, 2023
A Flutter plugin to use speech recognition on iOS & Android (Swift/Java)

speech_recognition A flutter plugin to use the speech recognition iOS10+ / Android 4.1+ Basic Example Sytody, speech to todo app Installation Depend o

Erick Ghaumez 331 Dec 19, 2022
Social media for super cool developers 🧑🏾‍💻👋🏽

Develove ????‍?? Demo link: Develove App release: Develove.apk Develove is a super cool social media forum that aims to bring in the best features of

Luxecraft 21 Dec 9, 2022
This is a flutter package of video player. it's a very simple and easy to use.

This is a flutter package of video player. it's a very simple and easy to use.

初冬 184 Nov 18, 2022
Music Player app made with Just audio library and Local database Hive.

Music Player app made with Just audio library and Local database Hive. Find the free and Royelty music with Happy Rock application. The app contains information about singers and you can make your own playlist with Songs.Happy rock App's features are same as the real music app like spotify, amazon music etc.

Ansh rathod 17 Dec 22, 2022