0.14.14 • Published 9 months ago

ngx-timeliner v0.14.14

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

NgxTimeliner

Описание

Библиотека таймлайна для видеоплеера

samplePic

Установка

Compatibility

Установка зависимостей

npm i ngx-timeliner --save

или

yarn add ngx-timeliner

Использование

Импортируйте модуль таймлайна

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

import { AppComponent } from './app.component';
import { NgxTimelinerModule } from 'projects/timeline/src/lib/timeline.module';

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

Используйте его в шаблоне

<ngx-timeliner
    class="canvas"
    [speed]="speed" 
    [playTime]="playTime" 
    [isPlayClick]="isPlayClick" 
    [videoCells]="videoCells" 
    [startTimeThreshold]="startTimeThreshold" 
    [endTimeThreshold]="endTimeThreshold" 
    [canvasHeight]="canvasHeight" 
    (playClick)="onPlayClick($event)"
>
</ngx-timeliner>

API

NameTypeDefault/ReturnDescription
canvasHeightnumber50Высота полотна (не ниже 50)
playTimenumber,string,Datenew Date().getTime()Время воспроизведения
speednumber1Скорость воспроизведения видео
startTimeThresholdnumber,string,Datenew Date().getTime() - 1 12 3600 * 1000Левый порог времени
endTimeThresholdnumber,string,Datenew Date().getTime() + 1 12 3600 * 1000Правый порог времени
videoCellsVideoCellType[]VideoCellType[]Блоки видео (окрашиваются в различные цвета)
borderColorstring"#fff"Цвет рамки полотна
bgColorstring"#fff"Цвет фона полотна
bottomLineColorstring"rgba(0,0,0,1)"Цвет нижней линии
verticalBarColorstring"rgba(0,0,0,1)"Цвет вертикальных линий
playBarColorstring"#448aff"Цвет бегунка
(mouseUp)anyreturnTime(Current timestamp)Возвращает текущее время при отпускании левой кнопки мыши
(mouseDown)anyreturnTime(Current timestamp)Возвращает текущее время при зажатой левой кнопки мыши

Interfate VideoCellType

fieldnametyperequired/optionaldefault
beginTimeThe start timenumber,stringrequiredundefined
endTimeThe end of timenumber,stringrequiredundefined
styleThe background colorbooleanoptionalVideoCellStyleType

Interfate VideoCellStyleType

fieldnametyperequired/optionaldefault
backgroundThe background colorstringrequiredundefined
1.0.0

8 months ago

0.14.14

9 months ago

0.12.13

9 months ago

0.12.12-preview

9 months ago

0.12.12

9 months ago

0.10.12

9 months ago