diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-14 17:16:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-14 17:16:32 +0100 |
commit | 8cac1b6446a97b16387c9590ce5c799a79a759fa (patch) | |
tree | 6ef95c108b9323e47d1b979a01934398b0752dac /client/src/standalone | |
parent | a16aee73db627908dc83eb5c29b213ce8d1fab39 (diff) | |
download | PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.tar.gz PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.tar.zst PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.zip |
Move adding a video view videojs peertube plugin
Diffstat (limited to 'client/src/standalone')
-rw-r--r-- | client/src/standalone/videos/embed.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 3193ae6ef..9076f1dc9 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts | |||
@@ -6,8 +6,12 @@ import '../../assets/player/peertube-videojs-plugin' | |||
6 | import 'videojs-dock/dist/videojs-dock.es.js' | 6 | import 'videojs-dock/dist/videojs-dock.es.js' |
7 | import { VideoDetails } from '../../../../shared' | 7 | import { VideoDetails } from '../../../../shared' |
8 | 8 | ||
9 | function getVideoUrl (id: string) { | ||
10 | return window.location.origin + '/api/v1/videos/' + videoId | ||
11 | } | ||
12 | |||
9 | async function loadVideoInfo (videoId: string): Promise<VideoDetails> { | 13 | async function loadVideoInfo (videoId: string): Promise<VideoDetails> { |
10 | const response = await fetch(window.location.origin + '/api/v1/videos/' + videoId) | 14 | const response = await fetch(getVideoUrl(videoId)) |
11 | return response.json() | 15 | return response.json() |
12 | } | 16 | } |
13 | 17 | ||
@@ -27,7 +31,8 @@ loadVideoInfo(videoId) | |||
27 | peertube: { | 31 | peertube: { |
28 | videoFiles: videoInfo.files, | 32 | videoFiles: videoInfo.files, |
29 | playerElement: videoElement, | 33 | playerElement: videoElement, |
30 | peerTubeLink: true | 34 | peerTubeLink: true, |
35 | videoViewUrl: getVideoUrl(videoId) + '/views' | ||
31 | }, | 36 | }, |
32 | hotkeys: { | 37 | hotkeys: { |
33 | enableVolumeScroll: false | 38 | enableVolumeScroll: false |