aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/video-watch.component.scss
blob: 1d83fa139ea30dd45f8d59101e3d80967f3945ee (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
@use '_bootstrap-variables';
@use '_miniature' as *;

@function getPlayerHeight ($width) {
  @return calc(#{$width} / #{$video-watch-player-factor});
}

@function getPlayerWidth ($height) {
  @return calc(#{$height} * #{$video-watch-player-factor});
}

@mixin playlist-below-player {
  width: 100% !important;
  height: auto !important;
  max-height: 300px !important;
  max-width: initial;
  border-bottom: 1px solid $separator-border-color !important;
}

.root {
  &.theater-enabled #video-wrapper {
    $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});

    flex-direction: column;
    justify-content: center;

    #videojs-wrapper {
      width: 100%;
      height: $height;
    }

    ::ng-deep .video-js {
      height: $height;
      width: 100%;
      max-width: initial;
    }

    my-video-watch-playlist ::ng-deep .playlist {
      @include playlist-below-player;
    }
  }
}

.blocked-label {
  font-weight: $font-semibold;
}

.placeholder-image {
  height: 100%;
}

#video-wrapper {
  $video-height: 66vh;

  background-color: #000;
  display: flex;
  justify-content: center;

  #videojs-wrapper {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    height: $video-height;
  }

  .remote-server-down {
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    background-color: #141313;
    width: 100%;
    font-size: 24px;
    height: 500px;

    @media screen and (max-width: 1000px) {
      font-size: 20px;
    }

    @media screen and (max-width: 600px) {
      font-size: 16px;
    }
  }

  ::ng-deep .video-js {
    width: 100%;
    max-width: getPlayerWidth(66vh);
    height: $video-height;

    // VideoJS create an inner video player
    video {
      outline: 0;
      position: relative !important;
    }
  }

  @media screen and (max-width: 600px) {
    #videojs-wrapper {
      height: getPlayerHeight(100vw) !important;
    }

    .remote-server-down,
    ::ng-deep .video-js {
      width: 100vw;
      height: getPlayerHeight(100vw) !important;
    }
  }
}

.alert {
  text-align: center;
  border-radius: 0;
}

.flex-direction-column {
  flex-direction: column;
}

#video-not-found {
  height: 300px;
  line-height: 300px;
  margin-top: 50px;
  text-align: center;
  font-weight: $font-semibold;
  font-size: 15px;
}

.video-bottom {
  display: flex;
  margin-top: 1.5rem;

  .video-info {
    flex-grow: 1;
    // Set min width for flex item
    min-width: 1px;
    max-width: 100%;

    .video-info-first-row {
      display: flex;

      > div:first-child {
        flex-grow: 1;
      }

      .video-info-name {
        @include peertube-word-wrap;

        @include margin-right(30px);

        min-height: 40px; // Align with the action buttons
        font-size: 27px;
        font-weight: $font-semibold;
        flex-grow: 1;
      }

      .video-info-first-row-bottom {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
      }

      .video-info-date-views {
        @include margin-right(10px);

        margin-bottom: 10px;
        align-self: start;
        font-size: 1em;
      }

      .video-info-channel {
        font-weight: $font-semibold;
        font-size: 15px;

        a {
          @include disable-default-a-behaviour;
          @include peertube-word-wrap;

          color: pvar(--mainForegroundColor);

          &:hover {
            opacity: 0.8;
          }
        }

        .video-info-channel-left {
          flex-grow: 1;

          .video-info-channel-left-links {
            display: flex;
            flex-direction: column;
            position: relative;
            line-height: 1.37;

            a:nth-of-type(2) {
              font-weight: $font-regular;
              font-size: 90%;
            }

            a.single-link {
              margin-top: 7px;
            }
          }
        }

        my-subscribe-button {
          @include margin-left(5px);
        }
      }
    }

    .video-attributes {
      @include margin-left($video-watch-info-margin-left);
    }

    .video-attributes .video-attribute {
      font-size: 13px;
      display: block;
      margin-bottom: 12px;

      .video-attribute-label {
        @include padding-right(5px);

        min-width: 142px;
        display: inline-block;
        color: pvar(--greyForegroundColor);
        font-weight: $font-bold;
      }

      a.video-attribute-value {
        @include disable-default-a-behaviour;
        color: pvar(--mainForegroundColor);

        &:hover {
          opacity: 0.9;
        }
      }

      &.video-attribute-tags {
        .video-attribute-value:not(:nth-child(2)) {
          &::before {
            content: ', ';
          }
        }
      }
    }
  }
}

my-action-buttons {
  @include margin-left(auto);
  @include margin-right(0);

  display: block;
  margin-top: 0;
  margin-bottom: 10px;

  align-items: start;
  width: max-content;
}

my-recommended-videos {
  @include padding-left(15px);

  display: block;
  min-width: 250px;
}

my-video-comments {
  display: inline-block;
  width: 100%;
  margin-bottom: 20px;
}

@media screen and (max-width: 1600px) {
  .video-bottom .video-info .video-attributes .video-attribute {
    margin-bottom: 5px;
  }
}

// Use the same breakpoint than in the typescript component to display the other video miniatures as row
@media screen and (max-width: 1100px) {
  #video-wrapper {
    flex-direction: column;
    justify-content: center;

    my-video-watch-playlist ::ng-deep .playlist {
      @include playlist-below-player;
    }
  }

  .video-bottom {
    flex-direction: column;
  }

  my-recommended-videos {
    @include padding-left(0);
  }
}

@media screen and (max-width: 600px) {
  .video-bottom {
    margin-top: 20px !important;
    padding-bottom: 20px !important;

    .video-info {
      padding: 0;

      .video-info-first-row {

        .video-info-name {
          font-size: 20px;
          height: auto;
        }
      }
    }
  }
}

@media screen and (max-width: 450px) {
  .video-bottom {
    .video-info .video-info-first-row {
      .video-info-name {
        font-size: 18px;
      }

      .video-info-date-views {
        font-size: 14px;
      }
    }
  }

  my-action-buttons {
    margin-top: 10px;
  }
}


// Special case for iOS, that takes into account the width for fullscreens
#video-wrapper ::ng-deep .video-js.vjs-fullscreen {
  max-width: unset;
}