play videos big

This commit is contained in:
Nolan Lawson 2018-02-04 15:08:34 -08:00
parent 1152d96289
commit 6e2fa24261
3 changed files with 4 additions and 8 deletions

View file

@ -5,7 +5,7 @@
<button type="button" <button type="button"
class="play-video-button" class="play-video-button"
aria-label="Play video: {{media.description || ''}}" aria-label="Play video: {{media.description || ''}}"
on:click="onClickPlayVideoButton(media, getSmallWidth(media), getSmallHeight(media), media.description)"> on:click="onClickPlayVideoButton(media, media.description)">
<div class="svg-wrapper"> <div class="svg-wrapper">
<svg> <svg>
<use xlink:href="#fa-play-circle" /> <use xlink:href="#fa-play-circle" />
@ -132,8 +132,8 @@
maxMediaWidth: (mediaAttachments) => Math.max.apply(Math, mediaAttachments.map(media => media.meta && media.meta.small && typeof media.meta.small.width === 'number' ? media.meta.small.width : DEFAULT_MEDIA_WIDTH)) maxMediaWidth: (mediaAttachments) => Math.max.apply(Math, mediaAttachments.map(media => media.meta && media.meta.small && typeof media.meta.small.width === 'number' ? media.meta.small.width : DEFAULT_MEDIA_WIDTH))
}, },
methods: { methods: {
async onClickPlayVideoButton(media, width, height, description) { async onClickPlayVideoButton(media, description) {
showVideoDialog(media.preview_url, media.url, width, height, description) showVideoDialog(media.preview_url, media.url, description)
} }
}, },
events: { events: {

View file

@ -1,8 +1,6 @@
<ModalDialog :shown> <ModalDialog :shown>
<video poster="{{poster}}" <video poster="{{poster}}"
src="{{src}}" src="{{src}}"
width="{{width}}"
height="{{height}}"
aria-label="Video: {{description || ''}}" aria-label="Video: {{description || ''}}"
controls controls
/> />

View file

@ -1,14 +1,12 @@
import VideoDialog from '../_components/status/VideoDialog.html' import VideoDialog from '../_components/status/VideoDialog.html'
import { createDialogElement } from './dialogs' import { createDialogElement } from './dialogs'
export function showVideoDialog(poster, src, width, height, description) { export function showVideoDialog(poster, src, description) {
let videoDialog = new VideoDialog({ let videoDialog = new VideoDialog({
target: createDialogElement('Video dialog'), target: createDialogElement('Video dialog'),
data: { data: {
poster: poster, poster: poster,
src: src, src: src,
width: width,
height: height,
description: description description: description
} }
}) })