Git Product home page Git Product logo

video_player_media_kit's Introduction

Video Player Media Kit

Video Player Media Kit is a platform interface for video player using media_kit to work on Windows and Linux and macos. This interface allows you to play videos seamlessly in your flutter application.

Note: this package allows video_player to work across platforms

How to use

To use Video Player Media Kit in your application, follow the steps below:

  1. Setup

Windows

Everything ready.

Linux

System shared libraries from distribution specific user-installed packages are used by-default. You can install these as follows.

Ubuntu / Debian

sudo apt install libmpv-dev mpv

Packaging

There are other ways to bundle these within your app package e.g. within Snap or Flatpak. Few examples:

Note: macos is not tested (if you have any problems open an issue)

macOS

Everything ready.

The minimum supported macOS version is 11.0,set MACOSX_DEPLOYMENT_TARGET = 11.0 macos\Runner.xcodeproj\project.pbxproj

Also, during the build phase, the following warnings are not critical and cannot be silenced:

#import "Headers/media_kit_video-Swift.h"
        ^
/path/to/media_kit/media_kit_test/build/macos/Build/Products/Debug/media_kit_video/media_kit_video.framework/Headers/media_kit_video-Swift.h:270:31: warning: 'objc_ownership' only applies to Objective-C object or block pointer types; type here is 'CVPixelBufferRef' (aka 'struct __CVBuffer *')
- (CVPixelBufferRef _Nullable __unsafe_unretained)copyPixelBuffer SWIFT_WARN_UNUSED_RESULT;
# 1 "<command line>" 1
 ^
<command line>:20:9: warning: 'POD_CONFIGURATION_DEBUG' macro redefined
#define POD_CONFIGURATION_DEBUG 1 DEBUG=1 
        ^
#define POD_CONFIGURATION_DEBUG 1
        ^

iOS (replace original video_player with media_kit one)

  1. The minimum supported iOS version is 13.0,set IPHONEOS_DEPLOYMENT_TARGET to 13.0 in ios\Runner.xcodeproj\project.pbxproj
  2. Just add this package in case you set iosUseMediaKit to true in initVideoPlayerMediaKitIfNeeded
dependencies:
  ...
  media_kit_libs_ios_video: ^1.0.4               # iOS package for video native libraries.

Android (replace original video_player with media_kit one)

  1. Just add this package in case you set androidUseMediaKit to true in initVideoPlayerMediaKitIfNeeded
dependencies:
  ...
  media_kit_libs_android_video: ^1.0.4           # Android package for video native libraries.
  1. Add the Video Player Media Kit dependency in your pubspec.yaml file:
dependencies:
  video_player_media_kit: ^0.0.11
  1. Import the package in your Dart code
import 'package:video_player_dart_vlc/video_player_media_kit.dart';
  1. Initialize the Video Player Media Kit interface in the main function of your app
void main() {
  initVideoPlayerMediaKitIfNeeded(); //parameter iosUseMediaKit can be used to make ios use media_kit instead of video_player
  runApp(MyApp());
}

now video_player will work on any platform.

video_player_media_kit's People

Contributors

abdelaziz-mahdy avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.