You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SharedVideoThumb.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* global $, APP */
  2. /* eslint-disable no-unused-vars */
  3. import React, { Component } from 'react';
  4. import ReactDOM from 'react-dom';
  5. import { I18nextProvider } from 'react-i18next';
  6. import { Provider } from 'react-redux';
  7. import { i18next } from '../../../react/features/base/i18n';
  8. import { Thumbnail } from '../../../react/features/filmstrip';
  9. import SmallVideo from '../videolayout/SmallVideo';
  10. /* eslint-enable no-unused-vars */
  11. /**
  12. *
  13. */
  14. export default class SharedVideoThumb extends SmallVideo {
  15. /**
  16. *
  17. * @param {*} participant
  18. */
  19. constructor(participant) {
  20. super();
  21. this.id = participant.id;
  22. this.isLocal = false;
  23. this.url = participant.id;
  24. this.videoSpanId = 'sharedVideoContainer';
  25. this.container = this.createContainer(this.videoSpanId);
  26. this.$container = $(this.container);
  27. this.renderThumbnail();
  28. this._setThumbnailSize();
  29. this.bindHoverHandler();
  30. this.container.onclick = this._onContainerClick;
  31. }
  32. /**
  33. *
  34. * @param {*} spanId
  35. */
  36. createContainer(spanId) {
  37. const container = document.createElement('span');
  38. container.id = spanId;
  39. container.className = 'videocontainer';
  40. const remoteVideosContainer
  41. = document.getElementById('filmstripRemoteVideosContainer');
  42. const localVideoContainer
  43. = document.getElementById('localVideoTileViewContainer');
  44. remoteVideosContainer.insertBefore(container, localVideoContainer);
  45. return container;
  46. }
  47. /**
  48. * Renders the thumbnail.
  49. */
  50. renderThumbnail(isHovered = false) {
  51. ReactDOM.render(
  52. <Provider store = { APP.store }>
  53. <I18nextProvider i18n = { i18next }>
  54. <Thumbnail participantID = { this.id } isHovered = { isHovered } />
  55. </I18nextProvider>
  56. </Provider>, this.container);
  57. }
  58. }