fijkplayer (Video player plugin for Flutter)

pub package

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

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

Installation

First, add fijkplayer as a dependency in your pubspec.yaml file.

iOS

Warning: The video player is not functional on iOS simulators. An iOS device must be used during development/testing.

Android

Ensure the following permission is present in your Android Manifest file if you want to play a network stream, located in <project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>

The example in this plugin project adds it, so it may already be there.

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,
            // panelSize: FijkPanelSize.MatchView,
            // alignment: Alignment.center,
            // aspectRatio: 1,
            // width: 320,
            // height: 180,
            // builder: defaultFijkPanelBuilder,
          ),
        ));
  }

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

Demo Screenshots

iOS screenshots

ios_input       ios_video

android screenshots

android_home       android_video

Libraries

fijkplayer