Add preview to embed
This commit is contained in:
parent
f981dae861
commit
43f61d2635
|
@ -23,6 +23,8 @@ export class Video implements VideoServerModel {
|
||||||
tags: string[]
|
tags: string[]
|
||||||
thumbnailPath: string
|
thumbnailPath: string
|
||||||
thumbnailUrl: string
|
thumbnailUrl: string
|
||||||
|
previewPath: string
|
||||||
|
previewUrl: string
|
||||||
views: number
|
views: number
|
||||||
likes: number
|
likes: number
|
||||||
dislikes: number
|
dislikes: number
|
||||||
|
@ -60,6 +62,7 @@ export class Video implements VideoServerModel {
|
||||||
podHost: string,
|
podHost: string,
|
||||||
tags: string[],
|
tags: string[],
|
||||||
thumbnailPath: string,
|
thumbnailPath: string,
|
||||||
|
previewPath: string,
|
||||||
views: number,
|
views: number,
|
||||||
likes: number,
|
likes: number,
|
||||||
dislikes: number,
|
dislikes: number,
|
||||||
|
@ -85,6 +88,8 @@ export class Video implements VideoServerModel {
|
||||||
this.tags = hash.tags
|
this.tags = hash.tags
|
||||||
this.thumbnailPath = hash.thumbnailPath
|
this.thumbnailPath = hash.thumbnailPath
|
||||||
this.thumbnailUrl = API_URL + hash.thumbnailPath
|
this.thumbnailUrl = API_URL + hash.thumbnailPath
|
||||||
|
this.previewPath = hash.previewPath
|
||||||
|
this.previewUrl = API_URL + hash.previewPath
|
||||||
this.views = hash.views
|
this.views = hash.views
|
||||||
this.likes = hash.likes
|
this.likes = hash.likes
|
||||||
this.dislikes = hash.dislikes
|
this.dislikes = hash.dislikes
|
||||||
|
|
|
@ -88,10 +88,9 @@
|
||||||
|
|
||||||
loadVideoInfos(videoId, function (videoInfos) {
|
loadVideoInfos(videoId, function (videoInfos) {
|
||||||
var magnetUri = videoInfos.magnetUri
|
var magnetUri = videoInfos.magnetUri
|
||||||
// FIXME: use poster?
|
var videoContainer = document.getElementById('video-container')
|
||||||
// var videoContainer = document.getElementById('video-container')
|
var previewUrl = window.location.protocol + '//' + videoInfos.podHost + videoInfos.previewPath
|
||||||
// var thumbnailUrl = 'http://' + videoInfos.podUrl + videoInfos.thumbnailPath
|
videoContainer.poster = previewUrl
|
||||||
// videoContainer.poster = thumbnailUrl
|
|
||||||
|
|
||||||
videojs('video-container', { controls: true, autoplay: false }, function () {
|
videojs('video-container', { controls: true, autoplay: false }, function () {
|
||||||
var player = this
|
var player = this
|
||||||
|
|
Loading…
Reference in New Issue