Code Monkey home page Code Monkey logo

capacitor-video-player's Introduction


Video Player

capacitor-video-player


CAPACITOR 3


Capacitor Video Player Plugin is a custom Native Capacitor plugin to play a video
fullscreen on IOS, Android, Web and Electron platforms
embedded on Web and Electron platforms


Maintainers

Maintainer GitHub Social
QuΓ©au Jean Pierre jepiqueau

LATEST FOR CAPACITOR 3 (Master)

The master release has been upgraded to @capacitor/[email protected].

🚨 Since release 3.3.1 ->> 🚨

the PIP (Picture in Picture) mode has been added to the Android (API >= N) and iOS (iPad - iOS >= 13, iPhone - iOS >= 14) plugins. Is it accessible by clicking on the PiP button next to the Close button on the top-left window corner.

In Android, to have it running in your application, you must include in the AndroidManifest.xmlfile under the <activity tag the following

    android:resizeableActivity="true"
    android:supportsPictureInPicture="true"

In iOS, to have it running in your application, you must set the Background Modes application capabilities and switch on the mode Audio, Air-Play, and Picture in Picture

🚨 Since release 3.3.1 <<- 🚨

PREVIOUS CAPACITOR 2.4.7

The 2.4.7 is now πŸ›‘ NOT MAINTAINED ANYMORE πŸ›‘ and can be used as is.

Browser Support

The plugin follows the guidelines from the Capacitor Team,

meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with Babel.

Installation

Release 2.4.7

npm install --save [email protected]
npx cap sync
npx cap sync @capacitor-community/electron
  • On Web and Electron, no further steps are needed.

  • on iOS, you need to set your app Capabilities Background Modes (Audio and AirPlay) in Xcode

  • On Android, register the plugin in your main activity:

import com.jeep.plugin.capacitor.CapacitorVideoPlayer;

public class MainActivity extends BridgeActivity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(
        savedInstanceState,
        new ArrayList<Class<? extends Plugin>>() {
          {
            // Additional plugins you've installed go here
            // Ex: add(TotallyAwesomePlugin.class);
            add(CapacitorVideoPlayer.class);
          }
        }
      );
  }
}

Release 3.0.0

npm install --save capacitor-video-player@latest
npx cap sync
npx cap sync @capacitor-community/electron
  • On Web and Electron ,
npm install --save hls.js
  • on iOS, you need to set your app Capabilities Background Modes (Audio and AirPlay) in Xcode

  • On Android, the AndroidManifest.xmlshould include

  <!-- Permissions -->

  <uses-permission android:name="android.permission.INTERNET" />
  <!-- Camera, Photos, input file -->
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Build

Then build YOUR_APPLICATION

npm run build
npx cap copy
npx cap copy web
npx cap copy @capacitor-community/electron
npx cap open android
npx cap open ios
npx cap open @capacitor-community/electron
npx cap serve

Configuration

No configuration required for this plugin

Supported methods

Name Android iOS Electron Web
initPlayer (mode fullscreen) βœ… βœ… βœ… βœ…
initPlayer (mode embedded) ❌ ❌ βœ… βœ…
initPlayer (url assets) βœ… βœ… βœ… βœ…
initPlayer (url internal) βœ… βœ… ❌ ❌
initPlayer (url application/files) βœ… βœ… ❌ ❌
initPlayer (subtitles) βœ… βœ… ❌ ❌
isPlaying βœ… βœ… βœ… βœ…
play βœ… βœ… βœ… βœ…
pause βœ… βœ… βœ… βœ…
getCurrentTime βœ… βœ… βœ… βœ…
setCurrentTime βœ… βœ… βœ… βœ…
getDuration βœ… βœ… βœ… βœ…
getMuted βœ… βœ… βœ… βœ…
setMuted βœ… βœ… βœ… βœ…
getVolume βœ… βœ… βœ… βœ…
setVolume βœ… βœ… βœ… βœ…
stopAllPlayers βœ… βœ… βœ… βœ…
getRate βœ… βœ… βœ… βœ…
setRate βœ… βœ… βœ… βœ…

Supported listeners

Name Android iOS Electron Web
jeepCapVideoPlayerReady βœ… βœ… βœ… βœ…
jeepCapVideoPlayerPlay βœ… βœ… βœ… βœ…
jeepCapVideoPlayerPause βœ… βœ… βœ… βœ…
jeepCapVideoPlayerEnded βœ… βœ… βœ… βœ…
jeepCapVideoPlayerExit βœ… βœ… βœ… βœ…

Documentation

API_Documentation

Applications demonstrating the use of the plugin

Application Starter 2.4.7

Application Starter 3.0.0 🚧

Usage 2.4.7

Usage 3.0.0 🚧

Dependencies

  • hls.js for HLS videos on Web and Electron platforms
  • ExoPlayer for HLS, DASH, SmoothStreaming videos on Android platform

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Jean Pierre QuΓ©au

πŸ’»

Yelhouti

πŸ’»

Mamane10

πŸ’»

ΠŸΡ€ΠΎΠ½ΠΈΠ½ АндрСй KANekT

πŸ’»

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

capacitor-video-player's People

Contributors

dependabot[bot] avatar jepiqueau avatar kanekt avatar msepena avatar muralisepena avatar ruudboon avatar yelhouti 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.