2.1.6 • Published 4 months ago

@inlasningstjanst/video-player v2.1.6

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

@inlasningstjanst/video-player

Manabua video player

Manabua video player is a module for showing videos from Inlasningstjanst.se

Installation

Use the package manager npm to install Manabua video player.

npm install @inlasningstjanst/video-player

Usage

Javascript

import { ILTVideoContainer } from '@inlasningstjanst/video-player'
import '@inlasningstjanst/video-player/dist/style.css'

var authToken  =  'token' // Token for access to AP
var elementID  =  'film_container'
var domain     =  'https://intro-films.inlasningstjanst.se'
var videoID    =  'wWpacPJfK8xJh2bV0u92H' // Required: film uid
var videoContainer = new ILTVideoContainer(authToken, videoID, domain, elementID);

window.addEventListener('load', () => {
    videoContainer.init();
});

// Video can also be initialized with an optional parameter "options"

// Example
var options = {
    'enabledButtons': ['theatre', 'subtitleSize'],
    'theatreContainerID': 'theatre_container', 
    'disabledLanguageTooltip': 'Example text',
}
// 'theatreContainerID' must be defined if 'enabledButtons' contains 'theatre'
var videoContainer = new ILTVideoContainer(authToken,  videoID,  domain,  elementID, options)

Available options

ValueTypeExampleDescription
statisticsEndpointStringhttps://intro-films.inlasningstjanst.se/public/v1/viewsURL to statistics endpoint
hlsString | Film hls
trackNameStringTrack nameFilm title
posterString/path/to/posterFilm image preview url
languagesArray[]Available languages
playbackRatesArray[0.5, 0.8, 1, 1.2, 1.5, 2]List of available playback rates
audioTracksArray[]List of audio files data
subtitleTracksArray[]List of subtitle files data
primaryLanguageCodeStringsweCode of default language
activeAudioTrackStringsweLanguage code of default language for audio
activeSubtitleTrackStringsweLanguage code of default language for subtitle
enabledButtonsArray['theatre','subtitleSize','share','fullscreen']Extra buttons
disabledLanguageTooltipBooleantrueOption for disabling language tooltip
theatreContainerIDStringtheatre_containerID for theatre container, fill if you need to have it
audioCaptionStringAudioText for audio caption
subtitleCaptionStringSubtitleText for subtitle caption
offCaptionStringOffText for off caption
routeString/path/to/videoCurrent route (for Vue.js purposes)
onActiveVideoLanguageChangeFunction({type: 'audio' \| 'subtitles', lang: string}) => {}Callback for audio or subtitle language change
onSubtitleLanguageChangeFunction(lang: string) => {}Callback for subtitle language change
onAudioLanguageChangeFunction(lang: string) => {}Callback for audio language change
siteLanguageStringsweLanguage code of default language

HTML

<!DOCTYPE  html>
<html>
	<script  type="text/javascript"  src="path/to/js"></script>
	<link  rel="stylesheet"  type="text/css"  href="path/to/css">
	<body>
		<div  id="film_container"></div>
	</body>
</html>

HTML (with theatreContainerID)

<!DOCTYPE  html>
<html>
	<script  type="text/javascript"  src="path/to/js"></script>
	<link  rel="stylesheet"  type="text/css"  href="path/to/css">
	<body>
		<div id="theatre_container">
			<div id="film_container"></div>
			<div id="optional_additional_container">For example a list of films</div>
		</div>
	</body>
</html>
2.1.6

4 months ago

2.1.5

4 months ago

2.1.4

4 months ago

2.1.3

5 months ago

2.1.2

5 months ago

2.1.1

5 months ago

2.1.0

5 months ago

1.1.12

10 months ago

2.0.0

6 months ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.7

1 year ago

1.1.5

1 year ago

1.1.1

1 year ago

1.1.0

2 years ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.0

2 years ago