13.0.2 • Published 2 years ago

ngx-video-list-player v13.0.2

Weekly downloads
162
License
MIT
Repository
github
Last release
2 years ago

NgxVideoListPlayer

This is an Angular module. It helps to integrate a video player with a video list. The video's base controls are disable and it uses custom controls for control video events.

Update

Support Youtube videos from v12.2.2

Info

No support for IE

Mobile browsers got different designe for an easier handling

In case of Youtube source, subtitles and PIP are not supported

npm downloads

Check out the demo!

Note: v13.0.2 is out and supports Angular 13!

Install

1) Install by running npm install ngx-video-list-player

2) Add NgxVideoListPlayerModule to your app.module.ts imports:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { NgxVideoListPlayerModule } from 'ngx-video-list-player';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxVideoListPlayerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Important: This module uses custom SVGs, so import of these are REQUIRED!!

3) Next step is to import these:

angular.json

"assets": [              
              {
                "glob": "**/*",
                "input": "./node_modules/ngx-video-list-player/assets",
                "output": "/assets/"
              }            
          ],

Important: folder contents of ./node_modules/ngx-video-list-player/assets always have to be in assets folder under root

4) From v12.2.2 you have to install youtube-player package as devDependency if npm didn't install automatic: npm install @angular/youtube-player --save-dev

5) From v12.2.2 you have to add Youtube API script to index.html: <script src="https://www.youtube.com/iframe_api"></script>

Basics

Usage

You can use this module easily after imports. Just use ngx-video-list-player tag in your html and give a config for it like an @Input(). For example:

app.component.html

<ngx-video-list-player [config]="config">

</ngx-video-list-player>

app.component.ts

import { IVideoConfig } from "ngx-video-list-player";

...

export class AppComponent {
    config: IVideoConfig = {
        sources: [
        {
            src: "{video1_src}",
            videoName: "{video1_name}",
            artist: "{video1_artist}"
        },
        //In case of Youtube
        {
            src: "xxxxxxxx", //e.g.: https://www.youtube.com/watch?v=xxxxxxxx
            videoName: "{video1_name}",
            artist: "{video1_artist}",
            isYoutubeVideo: true
        },
        {
            src: "{video2_src}",
            videoName: "{video2_name}",
            artist: "{video2_artist}"
        }]          
    };
...
}

Config properties

Inputs

PropertyTypeDescription
configIVideoConfigConfig: see below the details

Outputs

PropertyParameterDescription
onTimeUpdateemptyFire at each ontimeupdate event
onCanPlayemptyFire at each onCanPlay event
onLoadedMetadataemptyFire at each onLoadedMetadata event

IVideoConfig

PropertyTypeDescription
sourcesIVideoSource[]Video sources comes here
isVideoLoaderboolean?In case of slow source load you can use loader animation while waiting for first load. Default is true
isAutoPlayboolean?If you set more than one source, afterwhen the video is over it plays the next video automatically. Default is false
isFirstVideoAutoPlayboolean?The first video plays automatically when site is loaded. According to the browser's rules, the video will start in muted status in this case. Default is false
videoListDisplayModestring?: inline, block, noneYou can override the video list responsive display logic for a fix display setting. !!This is not dynamic property
volumeCookieNamestring?If you fill it, browser saves current volume as a cookie. The cookie's name depends on what you set
videoIndexCookieNamestring?If you fill it, browser save current video index as a cookie. The cookie's name depends on what you set. Recommended to use unique cookie name in each tag
subtitleTextstring?Dynamic property for subtitle container's header text. Default is Subtitles
subtitleOffTextstring?Dynamic property for subtitle's turn off text. Default is Off

IVideoSource

PropertyTypeDescription
srcstringVideo source path
videoNamestring?Video name. Appear on top of the video and in the video list
typestring?Video type
artiststring?Video artist. Appear in the video list
subtitlesIVideoSubtitle[]?Video subtitles come here
isYoutubeVideoboolean?Video source is Youtube link

IVideoSubtitle

PropertyTypeDescription
srcstringSubtitle source path
namestringSubtitle name. Appear on the subtitle list
defaultboolean?Use the video player by default
13.0.2

2 years ago

13.0.1

2 years ago

12.2.5

3 years ago

12.2.6

3 years ago

12.2.7

3 years ago

12.2.8

3 years ago

12.2.2

3 years ago

12.2.3

3 years ago

12.2.4

3 years ago

12.2.1

3 years ago

11.0.10

3 years ago

11.0.13

3 years ago

11.0.11

3 years ago

11.0.12

3 years ago

11.0.9

3 years ago

11.0.7

3 years ago

11.0.8

3 years ago

11.0.6

3 years ago

11.0.5

3 years ago

11.0.4

3 years ago

11.0.3

3 years ago

11.0.2

3 years ago

11.0.1

3 years ago

11.0.0

3 years ago