hz-video is an haztivity resource to manage videos from different sources.
hz-video uses plyr under the hood.
npm i --save @haztivity/hz-video
- plyr
- @haztivity/core
- Import @haztivity/hz-video
- [Optional] You could import the default theme for plyr
import "plyr/dist/plyr.css";
- Add HzVideoResource to the page
- Config plyr
- Set
data-hz-resource="HzVideo"
import {PageFactory, Page, PageController, PageRegister} from "@haztivity/core";
import template from "./page.pug";
//Import the default theme of plyr
import "plyr/dist/plyr.css";
import {HzVideoResource} from "@haztivity/hz-video";
export let page: PageRegister = PageFactory.createPage(
{
name: "myPage",
resources: [
HzVideoResource
],
template: template
}
);
// Youtube
// Video id is the id of the youtube video
div(data-hz-resource="HzVideo", data-type="youtube" data-video-id="C0DPdy98e4c")
or
<!-- Youtube -->
<!-- Video id is the id of the youtube video -->
<div data-hz-resource="HzVideo", data-type="youtube", data-video-id="C0DPdy98e4c"></div>
All the options of jqQuiz quiz except functions could be specified by attributes using:
data-opt-plyr-[option]=[value]
If the option have multiple words, use dashes, for example loadSprite
have to be provided as load-sprite
For more info please visit plyr