|
@@ -7,7 +7,6 @@ import UIEvents from '../../../service/UI/UIEvents';
|
7
|
7
|
|
8
|
8
|
import VideoLayout from "../videolayout/VideoLayout";
|
9
|
9
|
import LargeContainer from '../videolayout/LargeContainer';
|
10
|
|
-import SmallVideo from '../videolayout/SmallVideo';
|
11
|
10
|
import Filmstrip from '../videolayout/Filmstrip';
|
12
|
11
|
|
13
|
12
|
import {
|
|
@@ -16,6 +15,8 @@ import {
|
16
|
15
|
} from '../../../react/features/base/participants';
|
17
|
16
|
import { dockToolbox, showToolbox } from '../../../react/features/toolbox';
|
18
|
17
|
|
|
18
|
+import SharedVideoThumb from './SharedVideoThumb';
|
|
19
|
+
|
19
|
20
|
export const SHARED_VIDEO_CONTAINER_TYPE = "sharedvideo";
|
20
|
21
|
|
21
|
22
|
/**
|
|
@@ -255,7 +256,8 @@ export default class SharedVideoManager {
|
255
|
256
|
// in onPlayerStateChange
|
256
|
257
|
player.playVideo();
|
257
|
258
|
|
258
|
|
- let thumb = new SharedVideoThumb(self.url);
|
|
259
|
+ let thumb = new SharedVideoThumb(
|
|
260
|
+ self.url, SHARED_VIDEO_CONTAINER_TYPE, VideoLayout);
|
259
|
261
|
thumb.setDisplayName(player.getVideoData().title);
|
260
|
262
|
VideoLayout.addRemoteVideoContainer(self.url, thumb);
|
261
|
263
|
|
|
@@ -639,90 +641,6 @@ class SharedVideoContainer extends LargeContainer {
|
639
|
641
|
}
|
640
|
642
|
}
|
641
|
643
|
|
642
|
|
-function SharedVideoThumb (url)
|
643
|
|
-{
|
644
|
|
- this.id = url;
|
645
|
|
-
|
646
|
|
- this.url = url;
|
647
|
|
- this.setVideoType(SHARED_VIDEO_CONTAINER_TYPE);
|
648
|
|
- this.videoSpanId = "sharedVideoContainer";
|
649
|
|
- this.container = this.createContainer(this.videoSpanId);
|
650
|
|
- this.$container = $(this.container);
|
651
|
|
- this.container.onclick = this.videoClick.bind(this);
|
652
|
|
- this.bindHoverHandler();
|
653
|
|
- SmallVideo.call(this, VideoLayout);
|
654
|
|
- this.isVideoMuted = true;
|
655
|
|
-}
|
656
|
|
-SharedVideoThumb.prototype = Object.create(SmallVideo.prototype);
|
657
|
|
-SharedVideoThumb.prototype.constructor = SharedVideoThumb;
|
658
|
|
-
|
659
|
|
-/**
|
660
|
|
- * hide display name
|
661
|
|
- */
|
662
|
|
-
|
663
|
|
-SharedVideoThumb.prototype.setDeviceAvailabilityIcons = function () {};
|
664
|
|
-
|
665
|
|
-SharedVideoThumb.prototype.avatarChanged = function () {};
|
666
|
|
-
|
667
|
|
-SharedVideoThumb.prototype.createContainer = function (spanId) {
|
668
|
|
- var container = document.createElement('span');
|
669
|
|
- container.id = spanId;
|
670
|
|
- container.className = 'videocontainer';
|
671
|
|
-
|
672
|
|
- // add the avatar
|
673
|
|
- var avatar = document.createElement('img');
|
674
|
|
- avatar.className = 'sharedVideoAvatar';
|
675
|
|
- avatar.src = "https://img.youtube.com/vi/" + this.url + "/0.jpg";
|
676
|
|
- container.appendChild(avatar);
|
677
|
|
-
|
678
|
|
- const displayNameContainer = document.createElement('div');
|
679
|
|
- displayNameContainer.className = 'displayNameContainer';
|
680
|
|
- container.appendChild(displayNameContainer);
|
681
|
|
-
|
682
|
|
- var remotes = document.getElementById('filmstripRemoteVideosContainer');
|
683
|
|
- return remotes.appendChild(container);
|
684
|
|
-};
|
685
|
|
-
|
686
|
|
-/**
|
687
|
|
- * The thumb click handler.
|
688
|
|
- */
|
689
|
|
-SharedVideoThumb.prototype.videoClick = function () {
|
690
|
|
- VideoLayout.handleVideoThumbClicked(this.url);
|
691
|
|
-};
|
692
|
|
-
|
693
|
|
-/**
|
694
|
|
- * Removes RemoteVideo from the page.
|
695
|
|
- */
|
696
|
|
-SharedVideoThumb.prototype.remove = function () {
|
697
|
|
- logger.log("Remove shared video thumb", this.id);
|
698
|
|
-
|
699
|
|
- // Make sure that the large video is updated if are removing its
|
700
|
|
- // corresponding small video.
|
701
|
|
- this.VideoLayout.updateAfterThumbRemoved(this.id);
|
702
|
|
-
|
703
|
|
- // Remove whole container
|
704
|
|
- if (this.container.parentNode) {
|
705
|
|
- this.container.parentNode.removeChild(this.container);
|
706
|
|
- }
|
707
|
|
-};
|
708
|
|
-
|
709
|
|
-/**
|
710
|
|
- * Sets the display name for the thumb.
|
711
|
|
- */
|
712
|
|
-SharedVideoThumb.prototype.setDisplayName = function(displayName) {
|
713
|
|
- if (!this.container) {
|
714
|
|
- logger.warn( "Unable to set displayName - " + this.videoSpanId +
|
715
|
|
- " does not exist");
|
716
|
|
- return;
|
717
|
|
- }
|
718
|
|
-
|
719
|
|
- this.updateDisplayName({
|
720
|
|
- displayName: displayName || '',
|
721
|
|
- elementID: `${this.videoSpanId}_name`,
|
722
|
|
- participantID: this.id
|
723
|
|
- });
|
724
|
|
-};
|
725
|
|
-
|
726
|
644
|
/**
|
727
|
645
|
* Checks if given string is youtube url.
|
728
|
646
|
* @param {string} url string to check.
|