function _update()

in openmeetings-web/src/main/front/src/room/video.js [361:417]


		function _update(_c) {
			const prevA = sd.activities
				, prevW = vidSize.width || sd.width // try to check actual size of video first
				, prevH = vidSize.height || sd.height // try to check actual size of video first
				, prevCam = sd.cam
				, prevMic = sd.mic;
			sd.activities = _c.activities.sort();
			sd.level = _c.level;
			sd.user.firstName = _c.user.firstName;
			sd.user.lastName = _c.user.lastName;
			sd.user.displayName = _c.user.displayName;
			sd.width = _c.width;
			sd.height = _c.height;
			sd.cam = _c.cam;
			sd.mic = _c.mic;
			const name = sd.user.displayName;
			if (hasVideo) {
				v.dialog('option', 'title', name).parent().find('.ui-dialog-titlebar').attr('title', name);
			}
			const same = prevA.length === sd.activities.length
				&& prevA.every(function(value, index) { return value === sd.activities[index]})
				&& prevW === sd.width && prevH === sd.height
				&& prevCam == sd.cam && prevMic === sd.mic;
			const camChanged = sd.camEnabled !== _c.camEnabled
				, micChanged = sd.micEnabled !== _c.micEnabled
			if (sd.self && !same) {
				_cleanup();
				v.remove();
				_init({stream: sd, iceServers: iceServers});
			} else if (camChanged || micChanged) {
				sd.micEnabled = _c.micEnabled;
				sd.camEnabled = _c.camEnabled;
				const state = __getState();
				if (camChanged) {
					VideoMgrUtil.savePod(v);
					v.off();
					if (v.dialog('instance')) {
						v.dialog('destroy');
					}
					v.remove();
					__initUI(v.data('instance-uid'));
					__createVideo(state);
					VideoUtil.playSrc(state.video[0], state.stream || state.rStream, sd.self);
					if (state.data.analyser) {
						lm = vc.find('.level-meter');
						level.setCanvas(lm);
					}
				}
				if (micChanged) {
					__updateVideo(state);
				}
				if (sd.self) {
					state.localStream.getVideoTracks().forEach(track => track.enabled = sd.camEnabled);
					state.localStream.getAudioTracks().forEach(track => track.enabled = sd.micEnabled);
				}
			}
		}