Flutter Native Player for Flutter

Overview

Flutter Native Player for Flutter

A Flutter plugin for Android, iOS for playing back video on a Widget surface.

20220122_104448

Installation

Copy and paste to dependencies:

flutter_native_player: ^1.0.3

Note: iOS requires 10.0 or higher and Android requires SDK 16 or higher

Example:

import 'package:flutter/material.dart';
import 'package:flutter_native_player/flutter_native_player.dart';
import 'package:flutter_native_player/model/player_resource.dart';
import 'package:flutter_native_player/model/player_subtitle_resource.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State
   
     createState() => _MyAppState();
}

class _MyAppState extends State
    
      {

  String videoUrl = "https://d2cqvl54b1gtkt.cloudfront.net/PRODUCTION/5d85da3fa81ada4c66211a07/post/media/video/1616987127933-bfc1a13a-49c6-4272-8ffd-dc04b05eed2c/1616987128057-740d153b431660cf976789c1901192a961f0fd5b2a2af43e2388f671fa03c2aa/1616987128057-740d153b431660cf976789c1901192a961f0fd5b2a2af43e2388f671fa03c2aa.m3u8";
 final playerSubtitleResource = [
    PlayerSubtitleResource(
      language: "English",
      subtitleUrl: "https://raw.githubusercontent.com/Pisey-Nguon/Player-Resource/master/English_Transformers_The_Last_Knight_Official_Trailer_1_2017_Michael.srt",
      ),
  PlayerSubtitleResource(
      language: "Khmer",
      subtitleUrl: "https://raw.githubusercontent.com/Pisey-Nguon/Player-Resource/master/Khmer_Transformers_The_Last_Knight_Official_Trailer_1_2017_Michael.srt",
      )
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Native Player'),
      ),
      body: Center(
          child: FlutterNativePlayer(
                  playerResource: PlayerResource(videoUrl: videoUrl, playerSubtitleResource: playerSubtitleResource),
			      playWhenReady: true,
			      width: double.infinity,
			      height: 250
			      ),
		      ),
	      ),
      );
  }
}

    
   

Configuration:

  1. playWhenReady if it's true it's going to play immediately after fetching data success but if it's false that after fetching data success it's not played.
  2. playerSubtitleResource if null or empty list it's going to hide subtitle button.

Supported Formats

  • For Android, the backing player is ExoPlayer, please refer here for list of supported formats.
  • For iOS, the backing player is AVPlayer. The supported formats vary depending on the version of iOS, AVURLAsset class has audiovisualTypes that you can query for supported av formats.
You might also like...

A complete music player in flutter with cool UI and design.

A complete music player in flutter with cool UI and design.

Flutter Music Player A complete and open source music player designed in flutter. It is first complete music player designed in flutter. This app expl

Dec 30, 2022

First Open Source Flutter based material design music player with audio plugin to play online music

First Open Source Flutter based material design music player with audio plugin to play online music

Flutter Music App First Open Source Flutter based dribbblel Design Music Player. logo free design http://www.freeuid.com/category/free material icons

Jan 4, 2023

A Video Player For Vimeo Videos in Flutter. This plugin allows us to play video from Vimeo and it supports Android and iOS platforms.

A Video Player For Vimeo Videos in Flutter. This plugin allows us to play video from Vimeo and it supports Android and iOS platforms.

vimeo_video_player A Video Player For Vimeo Videos in Flutter. This plugin allow us to play video from vimeo and it's supports Android and iOS platfor

Dec 8, 2022

An audiobook downloader and player in flutter using librivox api (WIP)

An audiobook downloader and player in flutter using librivox api (WIP)

Flutter AudioBooks An audiobook listener and downloader in flutter using librivox API (WIP). Why? I wanted to make a beautiful AudioBook app, free for

Jan 5, 2023

A music player android application build using Flutter.

music_player A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Dec 28, 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

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.

May 15, 2022

FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Dec 30, 2022

Code Snippets of highly interactive Flutter Templates that can be implemented in a Native Flutter App.

Code Snippets of highly interactive Flutter Templates that can be implemented in a Native Flutter App.

Native Frontend Flutter About the Repository We are on a mission to make things easy and convenient for all the users who just want to save their time

Sep 5, 2022

A Sample Flutter project to show how to integrate native kotlin code with flutter

A Sample Flutter project to show how to integrate native kotlin code with flutter

kotlin_flashlight A Sample Flutter project to show how to integrate native kotlin code with flutter. Getting Started Visit this docs for Flutter setup

Apr 4, 2022
Releases(1.0.6)
Owner
Jane Roffer
Am stay focus
Jane Roffer
how to Integrating facebook audience network to flutter app for banner, interstitial, rewarded, native and native banner

fb_ads_flutter_12 A new Flutter project. Getting Started Watch the complite tutorial for integrating Facebook ads into the Flutter app in our Youtube

null 4 Nov 26, 2022
Flutter native ads - Show AdMob Native Ads use PlatformView

flutter_native_ads Flutter plugin for AdMob Native Ads. Compatible with Android and iOS using PlatformView. Android iOS Getting Started Android Androi

sakebook 64 Dec 20, 2022
react-native native module for In App Purchase.

Documentation Published in website. Announcement Version 8.0.0 is currently in release candidate. The module is completely rewritten with Kotlin and S

dooboolab 2.3k Dec 31, 2022
dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Assuner 14 Jul 11, 2022
Flutter-tunein - Music Player built with flutter

?? Flutter Music Player ⭐️ this repo if you like it. Getting Started ?? Clone the repo Install the dependicies Run it Todos Retrieve songs Retrieve fr

Bouaggad Moez 125 Oct 11, 2022
Flutter-Musive-app - Full-stack music player app written in flutter and dart using node.js music API

Musive Full-stack music player app is written in flutter and dart using node.js

Ansh rathod 69 Dec 28, 2022
A music player component for Flutter (i.e. Spotify, Apple Music, etc.) [AGPL/example/no longer maintaining]

This is an example I currently have no plans of putting this on Pub. Originally, I did, but I lost interest. However, I think this is a good example,

Tobe Osakwe 215 Dec 12, 2022
Dynamically themed Music Player built with flutter

?? Flutter Music Player Contact me email: [email protected] Gitter: https://gitter.im/Moda20TuneIn/community Thank you in advance ?? Getting Started

null 135 Dec 31, 2022
Kadi, A flutter based music Player

Kadi Music Player OpenSource Flutter Based Music Player with Fantastic UI Demo App Clone Build Run Features Android (iOS Coming Soon) Fetch local song

null 6 Jun 2, 2021
A music player app that allows you to search for music by artist made using Flutter

Music Player A music player app that allows you to search for music by artist. Music source from iTunes affiliate API. Made using Flutter with simple

muhibush 5 Feb 5, 2022