]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/embed.ts
Add messages about privacy concerns (P2P)
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed.ts
index 3193ae6ef560df29a8e4674d41fd194039a45ca4..bb6baf7f0a1ac100ceffdf7d6d9f179e5813cad7 100644 (file)
@@ -6,8 +6,12 @@ import '../../assets/player/peertube-videojs-plugin'
 import 'videojs-dock/dist/videojs-dock.es.js'
 import { VideoDetails } from '../../../../shared'
 
+function getVideoUrl (id: string) {
+  return window.location.origin + '/api/v1/videos/' + id
+}
+
 async function loadVideoInfo (videoId: string): Promise<VideoDetails> {
-  const response = await fetch(window.location.origin + '/api/v1/videos/' + videoId)
+  const response = await fetch(getVideoUrl(videoId))
   return response.json()
 }
 
@@ -27,7 +31,9 @@ loadVideoInfo(videoId)
         peertube: {
           videoFiles: videoInfo.files,
           playerElement: videoElement,
-          peerTubeLink: true
+          peerTubeLink: true,
+          videoViewUrl: getVideoUrl(videoId) + '/views',
+          videoDuration: videoInfo.duration
         },
         hotkeys: {
           enableVolumeScroll: false
@@ -38,7 +44,8 @@ loadVideoInfo(videoId)
       const player = this
 
       player.dock({
-        title: videoInfo.name
+        title: videoInfo.name,
+        description: 'Use P2P, other may know you are watching that video.'
       })
     })
   })