Skip to content

Commit

Permalink
Add preview to embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Jul 12, 2017
1 parent f981dae commit 43f61d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions client/src/app/videos/shared/video.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export class Video implements VideoServerModel {
tags: string[]
thumbnailPath: string
thumbnailUrl: string
previewPath: string
previewUrl: string
views: number
likes: number
dislikes: number
Expand Down Expand Up @@ -60,6 +62,7 @@ export class Video implements VideoServerModel {
podHost: string,
tags: string[],
thumbnailPath: string,
previewPath: string,
views: number,
likes: number,
dislikes: number,
Expand All @@ -85,6 +88,8 @@ export class Video implements VideoServerModel {
this.tags = hash.tags
this.thumbnailPath = hash.thumbnailPath
this.thumbnailUrl = API_URL + hash.thumbnailPath
this.previewPath = hash.previewPath
this.previewUrl = API_URL + hash.previewPath
this.views = hash.views
this.likes = hash.likes
this.dislikes = hash.dislikes
Expand Down
7 changes: 3 additions & 4 deletions client/src/standalone/videos/embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@

loadVideoInfos(videoId, function (videoInfos) {
var magnetUri = videoInfos.magnetUri
// FIXME: use poster?
// var videoContainer = document.getElementById('video-container')
// var thumbnailUrl = 'http://' + videoInfos.podUrl + videoInfos.thumbnailPath
// videoContainer.poster = thumbnailUrl
var videoContainer = document.getElementById('video-container')
var previewUrl = window.location.protocol + '//' + videoInfos.podHost + videoInfos.previewPath
videoContainer.poster = previewUrl

videojs('video-container', { controls: true, autoplay: false }, function () {
var player = this
Expand Down

0 comments on commit 43f61d2

Please sign in to comment.