1.2.0 • Published 6 years ago

ngx-video-scrubber v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

ngx-video-scrubber

npm version Build Status

Ngx-video-scrubber is an Angular X component, used to scrub a video during scrolling. Inspired by the websites of Apple.

DEMO

Installation

To install this library, run:

$ npm install ngx-video-scrubber

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the library
import { VideoScrubberModule } from 'ngx-video-scrubber';

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

Once the library is imported, you can use its components.

<ngx-video-scrubber [mp4]="'../assets/test.mp4'"></ngx-video-scrubber>

Parameters

Currently there are support for three movie formats. All can be used as input to the component. One is mandatory, the rest is optional.

InputDefault ValueOptionalDescription
mp4undefinedtrueMovie to scrub
movundefinedtrueMovie to scrub
oggundefinedtrueMovie to scrub
heightundefinedtrueOverride the calculated height of the movie. Used if you want a shorter scroll animation

Why is my movie lagging?

The number of keyframes might not be optimal. It is suggested to run the video trough FFMPEG before using it in the component.

To get the video to scroll smoothly run the following command in ffmpeg.

ffmpeg -i input.mp4 -g 10 output.mp4

License

MIT © Ertkjern

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.1.0

6 years ago