2020-11-09 20:59:13 +00:00
|
|
|
/* global $, APP */
|
2018-08-08 18:48:23 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { I18nextProvider } from 'react-i18next';
|
|
|
|
import { Provider } from 'react-redux';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
import { i18next } from '../../../react/features/base/i18n';
|
2021-01-06 23:45:48 +00:00
|
|
|
import { Thumbnail } from '../../../react/features/filmstrip';
|
2017-07-03 19:14:30 +00:00
|
|
|
import SmallVideo from '../videolayout/SmallVideo';
|
2020-11-09 20:59:13 +00:00
|
|
|
/* eslint-enable no-unused-vars */
|
2017-07-03 19:14:30 +00:00
|
|
|
|
2017-10-12 23:02:29 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2019-12-16 14:15:02 +00:00
|
|
|
export default class SharedVideoThumb extends SmallVideo {
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {*} participant
|
|
|
|
*/
|
2020-11-09 20:59:13 +00:00
|
|
|
constructor(participant) {
|
|
|
|
super();
|
2019-12-16 14:15:02 +00:00
|
|
|
this.id = participant.id;
|
2020-01-24 16:28:47 +00:00
|
|
|
this.isLocal = false;
|
2019-12-16 14:15:02 +00:00
|
|
|
this.url = participant.id;
|
|
|
|
this.videoSpanId = 'sharedVideoContainer';
|
|
|
|
this.container = this.createContainer(this.videoSpanId);
|
|
|
|
this.$container = $(this.container);
|
2020-11-09 20:59:13 +00:00
|
|
|
this.renderThumbnail();
|
2020-01-24 16:28:47 +00:00
|
|
|
this._setThumbnailSize();
|
2019-12-16 14:15:02 +00:00
|
|
|
this.bindHoverHandler();
|
|
|
|
this.container.onclick = this._onContainerClick;
|
|
|
|
}
|
2017-07-03 19:14:30 +00:00
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {*} spanId
|
|
|
|
*/
|
|
|
|
createContainer(spanId) {
|
|
|
|
const container = document.createElement('span');
|
2017-07-03 19:14:30 +00:00
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
container.id = spanId;
|
|
|
|
container.className = 'videocontainer';
|
2017-10-12 23:02:29 +00:00
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
const remoteVideosContainer
|
|
|
|
= document.getElementById('filmstripRemoteVideosContainer');
|
|
|
|
const localVideoContainer
|
|
|
|
= document.getElementById('localVideoTileViewContainer');
|
2017-10-12 23:02:29 +00:00
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
remoteVideosContainer.insertBefore(container, localVideoContainer);
|
2017-07-03 19:14:30 +00:00
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
return container;
|
2017-07-03 19:14:30 +00:00
|
|
|
}
|
|
|
|
|
2019-12-16 14:15:02 +00:00
|
|
|
/**
|
2020-11-09 20:59:13 +00:00
|
|
|
* Renders the thumbnail.
|
2019-12-16 14:15:02 +00:00
|
|
|
*/
|
2020-11-09 20:59:13 +00:00
|
|
|
renderThumbnail(isHovered = false) {
|
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store = { APP.store }>
|
|
|
|
<I18nextProvider i18n = { i18next }>
|
|
|
|
<Thumbnail participantID = { this.id } isHovered = { isHovered } />
|
|
|
|
</I18nextProvider>
|
|
|
|
</Provider>, this.container);
|
2019-12-16 14:15:02 +00:00
|
|
|
}
|
|
|
|
}
|