Git Product home page Git Product logo

flutter_meedu_videoplayer's Introduction

flutter_meedu_videoplayer

Buy Me A Coffee Buy Me a Coffee at ko-fi.com

Cross-Platform Video Player

We have implemented a cross-platform video player, which provides a seamless video playback experience.

๐Ÿ‘‹ ๐Ÿ‘‰ Complete documentation here

meedu_player meedu_player
meedu_player
FeatureiOSAndroidWindowsLinuxmacOSWeb
Videos from Networkโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Videos from Assetsโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Videos from Local Filesโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Loopingโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
AutoPlayโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Swipe to Control Volumeโœ”๏ธโœ”๏ธKeyboard ArrowsKeyboard ArrowsKeyboard ArrowsKeyboard Arrows
Swipe to Seekโœ”๏ธโœ”๏ธKeyboard ArrowsKeyboard ArrowsKeyboard ArrowsKeyboard Arrows
FullScreenโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Launch Player in FullScreenโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Playback Speedโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
Fast Forward/Rewindโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
SRT Subtitlesโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธโœ”๏ธ
CustomizationPartiallyPartiallyPartiallyPartiallyPartiallyPartially

Video Player Controls

Mobile Controls

  • Swipe horizontally to seek forward or backward in the video. (seekSwipes)
  • Swipe vertically on the right side of the screen to control the video volume. (volumeSwipes)
  • Swipe vertically on the left side of the screen to control the video brightness. (brightnessSwipes)
  • Double-tap on the sides of the screen to seek forward or backward in the video. (doubleTapToSeek)

Desktop Controls

  • One-click with the mouse to toggle play and pause. (desktopTapToPlayAndPause)
  • Double-click with the mouse to toggle full-screen mode. (desktopDoubleTapToFullScreen)
  • Use the keyboard up and down arrows to increase or decrease the video volume. (volumeArrows)
  • Use the keyboard right and left arrows to seek forward or backward in the video. (seekArrows)
  • Press the Escape key to close full-screen mode. (escapeKeyCloseFullScreen)
  • Press the NumPad Decimal key (.) to toggle the video fit. (numPadDecimalKeyToggleFit)
  • Press the Enter key to open full-screen mode. (enterKeyOpensFullScreen)
  • Press the Space key to toggle between playing and pausing the video. (spaceKeyTogglePlay)

Initialize

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

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, so the target needs to be 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 initMeeduPlayer
dependencies:
  ...
  media_kit_libs_ios_video: ^1.0.4         # iOS package for video (& audio) native libraries.

Also, software rendering is forced in the iOS simulator, due to an incompatibility with OpenGL ES.

Android (replace original video_player with media_kit one)

  1. Just add this package in case you set androidUseMediaKit to true in initMeeduPlayer
dependencies:
  ...
  media_kit_libs_android_video: ^1.0.3           # Android package for video native libraries.

hls on web

Add to pubspec.yaml

  video_player_web_hls: ^1.0.0+3

Add

    <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"  type="application/javascript"></script>

in index.html above

    <script src="main.dart.js" type="application/javascript"></script>

or above

    <script src="flutter.js" defer></script>

flutter_meedu_videoplayer's People

Contributors

abdelaziz-mahdy avatar mohamed-etman avatar sidhu-patil avatar nikitatg avatar andrezanna avatar 0franky avatar giriss avatar joaojsrbr 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.