Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

SharedVideoThumb.js 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* global $ */
  2. import SmallVideo from '../videolayout/SmallVideo';
  3. const logger = require('jitsi-meet-logger').getLogger(__filename);
  4. /**
  5. *
  6. */
  7. export default class SharedVideoThumb extends SmallVideo {
  8. /**
  9. *
  10. * @param {*} participant
  11. * @param {*} videoType
  12. * @param {*} VideoLayout
  13. */
  14. constructor(participant, videoType, VideoLayout) {
  15. super(VideoLayout);
  16. this.id = participant.id;
  17. this.url = participant.id;
  18. this.setVideoType(videoType);
  19. this.videoSpanId = 'sharedVideoContainer';
  20. this.container = this.createContainer(this.videoSpanId);
  21. this.$container = $(this.container);
  22. this.bindHoverHandler();
  23. this.isVideoMuted = true;
  24. this.updateDisplayName();
  25. this.container.onclick = this._onContainerClick;
  26. }
  27. /**
  28. *
  29. */
  30. initializeAvatar() {} // eslint-disable-line no-empty-function
  31. /**
  32. *
  33. * @param {*} spanId
  34. */
  35. createContainer(spanId) {
  36. const container = document.createElement('span');
  37. container.id = spanId;
  38. container.className = 'videocontainer';
  39. // add the avatar
  40. const avatar = document.createElement('img');
  41. avatar.className = 'sharedVideoAvatar';
  42. avatar.src = `https://img.youtube.com/vi/${this.url}/0.jpg`;
  43. container.appendChild(avatar);
  44. const displayNameContainer = document.createElement('div');
  45. displayNameContainer.className = 'displayNameContainer';
  46. container.appendChild(displayNameContainer);
  47. const remoteVideosContainer
  48. = document.getElementById('filmstripRemoteVideosContainer');
  49. const localVideoContainer
  50. = document.getElementById('localVideoTileViewContainer');
  51. remoteVideosContainer.insertBefore(container, localVideoContainer);
  52. return container;
  53. }
  54. /**
  55. * Triggers re-rendering of the display name using current instance state.
  56. *
  57. * @returns {void}
  58. */
  59. updateDisplayName() {
  60. if (!this.container) {
  61. logger.warn(`Unable to set displayName - ${this.videoSpanId
  62. } does not exist`);
  63. return;
  64. }
  65. this._renderDisplayName({
  66. elementID: `${this.videoSpanId}_name`,
  67. participantID: this.id
  68. });
  69. }
  70. }