Skip to content

bnussey/nativescript-videoplayer

 
 

Repository files navigation

npm npm

NativeScript Video Player 🎬

A NativeScript plugin to provide the ability to play local and remote videos.

Platform controls used:

Android iOS
Android VideoView iOS AVPlayer

Sample Usage

Sample Usage

Installation

From your command prompt/terminal go to your app's root folder and execute:

npm install nativescript-videoplayer

Usage

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
      xmlns:VideoPlayer="nativescript-videoplayer">
        <StackLayout>
            <VideoPlayer:Video
            src="~/videos/small.mp4"
            loaded="videoplayerLoaded" 
            finished="videoFinished" 
            autoplay="true" 
            height="300" />

            <!-- Remote file to test with https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 -->
            
        </StackLayout>
</Page>

Attributes

src - required

Attribute to specify the video file to play, for best performance use local video files if possible. The file must adhere to the platforms accepted video formats. For reference check the platform specs on playing videos.

autoplay - (boolean) - optional

Attribute to set if the video should start playing as soon as possible or to wait for user interaction.

finished - (function) - optional

Attribute to specify an event callback to execute when the video reaches the end of its duration.

Contributors

About

🎬 Video Player widget for NativeScript apps 🎬

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.6%
  • JavaScript 2.2%
  • CSS 1.2%