Last active
December 5, 2018 19:28
-
-
Save slimPickens/e6c58de34e65838c0edc032d1ca75928 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import BlockNodeWithThumbnail from '../BlockNodeWithThumbnail'; | |
import { defaultAlignment } from '../MediaAlignment'; | |
import type { InlineNode } from '../InlineNode'; | |
import type { MediaAlignment } from '../MediaAlignment'; | |
import type { ImageProperties } from '../Image'; | |
export type McpOptions = { | |
alignment: MediaAlignment, | |
caption?: Array<InlineNode>, | |
isLooping?: boolean, | |
posterImageOverride: string | |
}; | |
export default class Mcp extends BlockNodeWithThumbnail<McpOptions> { | |
alignment: MediaAlignment | |
caption: Array<InlineNode> | |
isLooping: boolean | |
posterImageOverride: string | |
constructor(id: string, thumbnail: ImageProperties, options: McpOptions) { | |
super(id, thumbnail, options); | |
this.alignment = options.alignment || defaultAlignment; | |
this.caption = options.caption || []; | |
this.isLooping = options.isLooping || false; | |
this.posterImageOverride = this.imageOverride(thumbnail); | |
} | |
imageOverride(thumbnail: ImageProperties) { | |
let override; | |
return override; | |
} | |
static fromLinksupportId(linksupportId: string, thumbnail: ImageProperties, options: McpOptions) { | |
const videoId = linksupportId.replace('mcp-', ''); | |
return new Mcp(videoId, thumbnail, options); | |
} | |
} | |
Mcp.type = 'Mcp'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment