Refactor
This commit is contained in:
parent
f054546aa6
commit
48a55a4a97
51 changed files with 604 additions and 577 deletions
21
src/framework/primitives/implementations/video.ts
Normal file
21
src/framework/primitives/implementations/video.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { Primitive } from '../primitive';
|
||||
import { url } from '../../../model/misc';
|
||||
|
||||
export class Video implements Primitive {
|
||||
public constructor(
|
||||
private readonly poster: url,
|
||||
private readonly mp4: url,
|
||||
private readonly webm: url,
|
||||
private readonly options?: string
|
||||
) {}
|
||||
public toHTML(disableInnerShadow = false): string {
|
||||
return `
|
||||
${!disableInnerShadow ? `<div class="figure-container">` : ''}
|
||||
<video ${this.options} poster="${this.poster}">
|
||||
<source src="${this.webm}" type="video/webm"/>
|
||||
<source src="${this.mp4}" type="video/mp4"/>
|
||||
</video>
|
||||
${!disableInnerShadow ? `</div>` : ''}
|
||||
`;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue