Skip to content

Instantly share code, notes, and snippets.

@slimPickens
Last active December 5, 2018 19:28
Show Gist options
  • Save slimPickens/e6c58de34e65838c0edc032d1ca75928 to your computer and use it in GitHub Desktop.
Save slimPickens/e6c58de34e65838c0edc032d1ca75928 to your computer and use it in GitHub Desktop.
// @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