From 95506e50d9eb999638de0315ded74500cd5fcc24 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Fri, 27 Apr 2018 15:11:40 +0000 Subject: [PATCH] Fixed screenshare extension toast and removed dock leftover code --- .../imports/ui/components/media/component.jsx | 1 + .../imports/ui/components/media/container.jsx | 28 +++++++ .../video-provider/video-dock/component.jsx | 77 ------------------- .../video-provider/video-dock/container.jsx | 11 --- .../video-provider/video-dock/styles.scss | 0 5 files changed, 29 insertions(+), 88 deletions(-) delete mode 100755 bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx delete mode 100755 bigbluebutton-html5/imports/ui/components/video-provider/video-dock/container.jsx delete mode 100644 bigbluebutton-html5/imports/ui/components/video-provider/video-dock/styles.scss diff --git a/bigbluebutton-html5/imports/ui/components/media/component.jsx b/bigbluebutton-html5/imports/ui/components/media/component.jsx index b87e798be3..8b9aab9e44 100644 --- a/bigbluebutton-html5/imports/ui/components/media/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/component.jsx @@ -17,6 +17,7 @@ const defaultProps = { hideOverlay: true, }; + export default class Media extends Component { componentWillUpdate() { window.dispatchEvent(new Event('resize')); diff --git a/bigbluebutton-html5/imports/ui/components/media/container.jsx b/bigbluebutton-html5/imports/ui/components/media/container.jsx index 94e7c2ffda..02c55213bd 100755 --- a/bigbluebutton-html5/imports/ui/components/media/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/container.jsx @@ -20,12 +20,25 @@ const intlMessages = defineMessages({ id: 'app.media.screenshare.end', description: 'toast to show when a screenshare has ended', }, + chromeExtensionError: { + id: 'app.video.chromeExtensionError', + description: 'Error message for Chrome Extension not installed', + }, + chromeExtensionErrorLink: { + id: 'app.video.chromeExtensionErrorLink', + description: 'Error message for Chrome Extension not installed', + }, }); class MediaContainer extends Component { componentWillMount() { const { willMount } = this.props; willMount && willMount(); + document.addEventListener('installChromeExtension', this.installChromeExtension.bind(this)); + } + + componentWillUnmount() { + document.removeEventListener('installChromeExtension', this.installChromeExtension.bind(this)); } componentWillReceiveProps(nextProps) { @@ -43,6 +56,21 @@ class MediaContainer extends Component { } } + installChromeExtension() { + const { intl } = this.props; + + const CHROME_DEFAULT_EXTENSION_LINK = Meteor.settings.public.kurento.chromeDefaultExtensionLink; + const CHROME_CUSTOM_EXTENSION_LINK = Meteor.settings.public.kurento.chromeExtensionLink; + const CHROME_EXTENSION_LINK = CHROME_CUSTOM_EXTENSION_LINK === 'LINK' ? CHROME_DEFAULT_EXTENSION_LINK : CHROME_CUSTOM_EXTENSION_LINK; + + notify(
+ {intl.formatMessage(intlMessages.chromeExtensionError)}{' '} + + {intl.formatMessage(intlMessages.chromeExtensionErrorLink)} + +
, 'error', 'desktop'); + } + render() { return ; } diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx deleted file mode 100755 index 09ccb25d35..0000000000 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx +++ /dev/null @@ -1,77 +0,0 @@ -import React, { Component } from 'react'; -import { defineMessages, injectIntl } from 'react-intl'; -import { notify } from '/imports/ui/services/notification'; - -import VideoList from '../video-list/component'; - -const intlMessages = defineMessages({ - chromeExtensionError: { - id: 'app.video.chromeExtensionError', - description: 'Error message for Chrome Extension not installed', - }, - chromeExtensionErrorLink: { - id: 'app.video.chromeExtensionErrorLink', - description: 'Error message for Chrome Extension not installed', - }, -}); - -class VideoDock extends Component { - constructor(props) { - super(props); - - this.state = {}; - } - - componentDidMount() { - document.addEventListener('installChromeExtension', this.installChromeExtension.bind(this)); - } - - componentWillUnmount() { - document.removeEventListener('installChromeExtension', this.installChromeExtension.bind(this)); - } - - notifyError(message) { - notify(message, 'error', 'video'); - } - - installChromeExtension() { - console.log(intlMessages); - const { intl } = this.props; - - const CHROME_DEFAULT_EXTENSION_LINK = Meteor.settings.public.kurento.chromeDefaultExtensionLink; - const CHROME_CUSTOM_EXTENSION_LINK = Meteor.settings.public.kurento.chromeExtensionLink; - - const CHROME_EXTENSION_LINK = CHROME_CUSTOM_EXTENSION_LINK === 'LINK' ? CHROME_DEFAULT_EXTENSION_LINK : CHROME_CUSTOM_EXTENSION_LINK; - - this.notifyError(
- {intl.formatMessage(intlMessages.chromeExtensionError)}{' '} - - {intl.formatMessage(intlMessages.chromeExtensionErrorLink)} - -
); - } - - render() { - const { - socketOpen, - users, - onStart, - onStop - } = this.props; - - if (!socketOpen) { - // TODO: return something when disconnected - return null; - } - - return ( - - ); - } -} - -export default injectIntl(VideoDock); diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/container.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/container.jsx deleted file mode 100755 index d68f9ef747..0000000000 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/container.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import { withTracker } from 'meteor/react-meteor-data'; -import VideoDock from './component'; -import VideoService from '../service'; - -const VideoDockContainer = ({ children, ...props }) => {children}; - -export default withTracker(() => ({ - users: VideoService.getAllUsersVideo(), - userId: VideoService.userId(), -}))(VideoDockContainer); diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/styles.scss b/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/styles.scss deleted file mode 100644 index e69de29bb2..0000000000