]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-watch/video-watch.component.html
Client: add share button
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-watch / video-watch.component.html
index 047990362736358cfc5fa0dc1739532c3157d3a3..f3a41636747ec32f75d84b7f5990585ac10e5067 100644 (file)
-<div *ngIf="error" class="alert alert-danger">
-  The video load seems to be abnormally long. You could:
-  <ul>
-    <li>Check your browser console to see potentials errors</li>
-    <li>Your firewall or NAT could be too restrictive for WebRTC (there is no TURN server)</li>
-    <li>
-      Report an issue on
-      <a href="https://github.com/Chocobozzz/PeerTube/issues" title="Report an issue">
-        https://github.com/Chocobozzz/PeerTube/issues
+<div *ngIf="error" class="row">
+  <div class="alert alert-danger">
+    The video load seems to be abnormally long.
+    <ul>
+      <li>Maybe the server {{ video.podUrl }} is down :(</li>
+      <li>
+        If not, you can report an issue on
+        <a href="https://github.com/Chocobozzz/PeerTube/issues" title="Report an issue">
+          https://github.com/Chocobozzz/PeerTube/issues
+        </a>
+      </li>
+    </ul>
+  </div>
+</div>
+
+<div class="row">
+  <div class="col-md-12">
+    <div class="embed-responsive embed-responsive-19by9">
+       <video id="video-container" class="video-js vjs-default-skin vjs-big-play-centered"></video>
+    </div>
+  </div>
+</div>
+
+<div id="torrent-info" class="row">
+  <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div>
+  <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div>
+  <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div>
+</div>
+
+<div *ngIf="video !== null" id="video-info">
+  <div class="row" id="video-name-actions">
+    <div class="col-md-8">
+      <div class="row">
+        <div id="video-name" class="col-md-12">
+          {{ video.name }}
+        </div>
+      </div>
+
+      <div class="row">
+        <div class="col-md-12" id="video-by-date">
+          <span id="video-by">
+              from
+              <a [routerLink]="['/videos/list', { field: 'author', search: video.author }]" class="video-miniature-author">
+                {{ video.by }}
+              </a>
+            </span>
+          <span id="video-date">on {{ video.createdDate | date:'short' }}</span>
+        </div>
+      </div>
+    </div>
+
+    <div id="video-actions" class="col-md-4 text-right">
+      <button id="share" class="btn btn-default" (click)="showShareModal()">
+        <span class="glyphicon glyphicon-share"></span> Share
+      </button>
+
+      <button title="Get magnet URI" id="magnet-uri" class="btn btn-default" (click)="showMagnetUriModal()">
+        <span class="glyphicon glyphicon-magnet"></span> Magnet
+      </button>
+    </div>
+  </div>
+
+  <div id="video-tags" class="row">
+    <div class="col-md-12">
+      <a *ngFor="let tag of video.tags" [routerLink]="['/videos/list', { field: 'tags', search: tag }]" class="label label-primary">
+        {{ tag }}
       </a>
-    </li>
-  </ul>
+    </div>
+  </div>
+
+  <div id="video-description" class="row">
+    <div class="col-md-12">
+      <div id="description-label">Description</div>
+      {{ video.description }}
+    </div>
+  </div>
 </div>
 
-<div class="embed-responsive embed-responsive-19by9">
-  <my-loader [loading]="loading"></my-loader>
+<div *ngIf="video !== null" bsModal #magnetUriModal="bs-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="magnetUriModal" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content modal-lg">
+
+      <div class="modal-header">
+        <button type="button" class="close" aria-label="Close" (click)="hideMagnetUriModal()">
+          <span aria-hidden="true">&times;</span>
+        </button>
+        <h4 class="modal-title">Magnet Uri</h4>
+      </div>
+
+      <div class="modal-body">
+        <input #magnetUriInput (click)="magnetUriInput.select()" type="text" class="form-control input-sm" readonly [value]="video.magnetUri" />
+      </div>
+    </div>
+  </div>
 </div>
 
-<div id="torrent-info">
-  <div id="torrent-info-download">Download: {{ downloadSpeed | bytes }}/s</div>
-  <div id="torrent-info-upload">Upload: {{ uploadSpeed | bytes }}/s</div>
-  <div id="torrent-info-peers">Number of peers: {{ numPeers }}</div>
-<div>
+<div *ngIf="video !== null" bsModal #shareModal="bs-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="shareModal" aria-hidden="true">
+  <div class="modal-dialog modal-lg">
+    <div class="modal-content">
+
+      <div class="modal-header">
+        <button type="button" class="close" aria-label="Close" (click)="hideShareModal()">
+          <span aria-hidden="true">&times;</span>
+        </button>
+        <h4 class="modal-title">Share</h4>
+      </div>
+
+      <div class="modal-body">
+        <div class="form-group">
+          <label>URL</label>
+          <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm" readonly [value]="getVideoUrl()" />
+        </div>
+
+        <div class="form-group">
+          <label>Embed</label>
+          <input #shareInput (click)="shareInput.select()" type="text" class="form-control input-sm" readonly [value]="getVideoIframeCode()" />
+        </div>
+      </div>
+    </div>
+  </div>
+</div>