mirror of https://github.com/jitsi/jitsi-meet
When do we need tracks? - Welcome page (only the video track) - Conference (depends if starting with audio / video muted is requested) When do we need to destroy the tracks? - When we are not in a conference and there is no welcome page In order to accommodate all the above use cases, a new component is introduced: BlankWelcomePage. Its purpose is to take the place of the welcome page when it is disabled. When this component is mounted local tracks are destroyed. Analogously, a video track is created when the (real) welcome page is created, and all the desired tracks are created then the Conference component is created. What are desired tracks? These are the tracks we'd like to use for the conference that is about to happen. By default both audio and video are desired. It's possible, however, the user requested to start the call with no video/audio, in which case it's muted in base/media and a track is not created. The first time the app starts (with the welcome page) it will request permission for video only, since there is no need for audio in the welcome page. Later, when a conference is joined permission for audio will be requested when an audio track is to be created. The audio track is not destroyed when the conference ends. Yours truly thinks this is not needed since it's a stopped track which is not using system resources.pull/1906/head
parent
3102ea6818
commit
9bca0e3b3d
@ -0,0 +1,49 @@ |
||||
import PropTypes from 'prop-types'; |
||||
import { Component } from 'react'; |
||||
import { connect } from 'react-redux'; |
||||
|
||||
import { destroyLocalTracks } from '../../base/tracks'; |
||||
|
||||
/** |
||||
* Component for rendering a blank welcome page. It renders absolutely nothing |
||||
* and destroys local tracks upon being mounted, since no media is desired when |
||||
* this component is rendered. |
||||
* |
||||
* The use case is mainly mobile, where SDK users probably disable the welcome |
||||
* page, but using it on the web in the future is not out of the question. |
||||
*/ |
||||
class BlankWelcomePage extends Component { |
||||
/** |
||||
* {@code BlankWelcomePage} component's property types. |
||||
* |
||||
* @static |
||||
*/ |
||||
static propTypes = { |
||||
dispatch: PropTypes.func |
||||
}; |
||||
|
||||
/** |
||||
* Destroys the local tracks (if any) since no media is desired when this |
||||
* component is rendered. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {void} |
||||
*/ |
||||
componentWillMount() { |
||||
this.props.dispatch(destroyLocalTracks()); |
||||
} |
||||
|
||||
/** |
||||
* Implements React's {@link Component#render()}. In this particular case |
||||
* we return null, because the entire purpose of this component is to render |
||||
* nothing. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {null} |
||||
*/ |
||||
render() { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
export default connect()(BlankWelcomePage); |
@ -1 +1,2 @@ |
||||
export { default as BlankWelcomePage } from './BlankWelcomePage'; |
||||
export { default as WelcomePage } from './WelcomePage'; |
||||
|
Loading…
Reference in new issue