aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/video-watch.component.html
blob: 09be2d0859d0a8bd302d54ac60c3efccdb3e7656 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<div class="root" [ngClass]="{ 'theater-enabled': theaterEnabled }">
  <!-- We need the video container for videojs so we just hide it -->
  <div id="video-wrapper">
    <div *ngIf="remoteServerDown" class="remote-server-down">
      Sorry, but this video is not available because the remote instance is not responding.
      <br />
      Please try again later.
    </div>

    <div id="videojs-wrapper">
      <img class="placeholder-image" *ngIf="playerPlaceholderImgSrc" [src]="playerPlaceholderImgSrc" alt="Placeholder image" i18n-alt>
    </div>

    <my-video-watch-playlist
      #videoWatchPlaylist
      [playlist]="playlist" class="playlist"
      (videoFound)="onPlaylistVideoFound($event)"
    ></my-video-watch-playlist>

    <my-plugin-placeholder pluginId="player-next"></my-plugin-placeholder>
  </div>

  <div class="row">
    <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToImport()">
      The video is being imported, it will be available when the import is finished.
    </div>

    <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToTranscode()">
      The video is being transcoded, it may not work properly.
    </div>

    <div i18n class="col-md-12 alert alert-info" *ngIf="hasVideoScheduledPublication()">
      This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
    </div>

    <div i18n class="col-md-12 alert alert-info" *ngIf="isWaitingForLive()">
      This live has not started yet.
    </div>

    <div i18n class="col-md-12 alert alert-info" *ngIf="isLiveEnded()">
      This live has ended.
    </div>

    <div class="col-md-12 alert alert-danger" *ngIf="video?.blacklisted">
      <div class="blocked-label" i18n>This video is blocked.</div>
      {{ video.blockedReason }}
    </div>
  </div>

  <!-- Video information -->
  <div *ngIf="video" class="margin-content video-bottom">
    <div class="video-info">
      <div class="video-info-first-row">
        <div>
          <ng-template #publishedTemplate>
            <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container><my-video-views-counter [video]="video"></my-video-views-counter>
          </ng-template>

          <div class="d-block d-md-none"> <!-- only shown on medium devices, has its counterpart for larger viewports below -->
            <h1 class="video-info-name">{{ video.name }}</h1>

            <div class="video-info-date-views">
              <ng-template *ngTemplateOutlet="publishedTemplate"></ng-template>
            </div>
          </div>

          <div class="d-flex justify-content-between flex-direction-column">
            <div class="d-none d-md-block">
              <h1 class="video-info-name">{{ video.name }}</h1>
            </div>

            <div class="video-info-first-row-bottom">
              <div class="d-none d-md-block video-info-date-views">
                <ng-template *ngTemplateOutlet="publishedTemplate"></ng-template>
              </div>

              <my-action-buttons
                [video]="video" [isUserLoggedIn]="isUserLoggedIn()" [videoCaptions]="videoCaptions" [playlist]="playlist"
                [currentTime]="getCurrentTime()" [currentPlaylistPosition]="getCurrentPlaylistPosition()"
              ></my-action-buttons>
            </div>
          </div>

          <div class="pt-3 border-top video-info-channel d-flex">
            <div class="video-info-channel-left d-flex">
              <my-video-avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></my-video-avatar-channel>

              <div class="video-info-channel-left-links ml-1">
                <ng-container *ngIf="!isChannelDisplayNameGeneric()">
                  <a [routerLink]="[ '/c', video.byVideoChannel ]" i18n-title title="Channel page">
                    {{ video.channel.displayName }}
                  </a>
                  <a [routerLink]="[ '/a', video.byAccount ]" i18n-title title="Account page">
                    <span i18n>By {{ video.byAccount }}</span>
                  </a>
                </ng-container>

                <ng-container *ngIf="isChannelDisplayNameGeneric()">
                  <a [routerLink]="[ '/a', video.byAccount ]" class="single-link" i18n-title title="Account page">
                    <span i18n>{{ video.byAccount }}</span>
                  </a>
                </ng-container>
              </div>
            </div>

            <my-subscribe-button #subscribeButton [videoChannels]="[video.channel]" size="small"></my-subscribe-button>
          </div>
        </div>

      </div>

      <my-video-description [video]="video"></my-video-description>

      <div class="video-attributes mb-3">
        <div class="video-attribute">
          <span i18n class="video-attribute-label">Privacy</span>
          <span class="video-attribute-value">{{ video.privacy.label }}</span>
        </div>

        <div *ngIf="video.isLocal === false" class="video-attribute">
          <span i18n class="video-attribute-label">Origin</span>
          <a class="video-attribute-value" target="_blank" rel="noopener noreferrer" [href]="getVideoUrl()">{{ video.originInstanceHost }}</a>
        </div>

        <div *ngIf="!!video.originallyPublishedAt" class="video-attribute">
          <span i18n class="video-attribute-label">Originally published</span>
          <span class="video-attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span>
        </div>

        <div class="video-attribute">
          <span i18n class="video-attribute-label">Category</span>
          <span *ngIf="!video.category.id" class="video-attribute-value">{{ video.category.label }}</span>
          <a
            *ngIf="video.category.id" class="video-attribute-value"
            [routerLink]="[ '/search' ]" [queryParams]="{ categoryOneOf: [ video.category.id ] }"
          >{{ video.category.label }}</a>
        </div>

        <div class="video-attribute">
          <span i18n class="video-attribute-label">Licence</span>
          <span *ngIf="!video.licence.id" class="video-attribute-value">{{ video.licence.label }}</span>
          <a
            *ngIf="video.licence.id" class="video-attribute-value"
            [routerLink]="[ '/search' ]" [queryParams]="{ licenceOneOf: [ video.licence.id ] }"
          >{{ video.licence.label }}</a>
        </div>

        <div class="video-attribute">
          <span i18n class="video-attribute-label">Language</span>
          <span *ngIf="!video.language.id" class="video-attribute-value">{{ video.language.label }}</span>
          <a
            *ngIf="video.language.id" class="video-attribute-value"
            [routerLink]="[ '/search' ]" [queryParams]="{ languageOneOf: [ video.language.id ] }"
          >{{ video.language.label }}</a>
        </div>

        <div class="video-attribute video-attribute-tags">
          <span i18n class="video-attribute-label">Tags</span>
          <a
            *ngFor="let tag of getVideoTags()"
            class="video-attribute-value" [routerLink]="[ '/search' ]" [queryParams]="{ tagsOneOf: [ tag ] }"
          >{{ tag }}</a>
        </div>

        <div class="video-attribute" *ngIf="!video.isLive">
          <span i18n class="video-attribute-label">Duration</span>
          <span class="video-attribute-value">{{ video.duration | myDurationFormatter }}</span>
        </div>
      </div>

      <my-video-comments
        class="border-top"
        [video]="video"
        [user]="user"
        (timestampClicked)="handleTimestampClicked($event)"
      ></my-video-comments>
    </div>

    <my-recommended-videos
      [displayAsRow]="displayOtherVideosAsRow()"
      [inputRecommendation]="{ uuid: video.uuid, tags: video.tags }"
      [playlist]="playlist"
      (gotRecommendations)="onRecommendations($event)"
    ></my-recommended-videos>
  </div>

  <my-privacy-concerns></my-privacy-concerns>
</div>

<my-player-styles></my-player-styles>