Просмотр исходного кода

Merge pull request #856 from jitsi/implement_muted_ended_track_events

feat(UI): Add UI support for camera issue detection
j8
Paweł Domas 8 лет назад
Родитель
Сommit
9b5d4b8ceb
3 измененных файлов: 12 добавлений и 7 удалений
  1. 7
    4
      conference.js
  2. 1
    0
      lang/main.json
  3. 4
    3
      modules/UI/UI.js

+ 7
- 4
conference.js Просмотреть файл

@@ -293,8 +293,13 @@ function createLocalTracks (options, checkForPermissionPrompt) {
293 293
             firefox_fake_device: config.firefox_fake_device,
294 294
             desktopSharingExtensionExternalInstallation:
295 295
                 options.desktopSharingExtensionExternalInstallation
296
-        }, checkForPermissionPrompt)
297
-        .catch(function (err) {
296
+        }, checkForPermissionPrompt).then( (tracks) => {
297
+            tracks.forEach((track) => {
298
+                track.on(TrackEvents.NO_DATA_FROM_SOURCE,
299
+                    APP.UI.showTrackNotWorkingDialog.bind(null, track));
300
+            });
301
+            return tracks;
302
+        }).catch(function (err) {
298 303
             console.error(
299 304
                 'failed to create local tracks', options.devices, err);
300 305
             return Promise.reject(err);
@@ -865,8 +870,6 @@ export default {
865 870
 
866 871
         return promise.then(function () {
867 872
             if (stream) {
868
-                stream.on(TrackEvents.TRACK_AUDIO_NOT_WORKING,
869
-                    APP.UI.showAudioNotWorkingDialog);
870 873
                 return room.addTrack(stream);
871 874
             }
872 875
         }).then(() => {

+ 1
- 0
lang/main.json Просмотреть файл

@@ -277,6 +277,7 @@
277 277
         "micNotFoundError": "Microphone was not found.",
278 278
         "micConstraintFailedError": "Yor microphone does not satisfy some of required constraints.",
279 279
         "micNotSendingData": "We are unable to access your microphone. Please select another device from the settings menu or try to restart the application.",
280
+        "cameraNotSendingData": "We are unable to access your camera. Please check if another application is using this device, select another device from the settings menu or try to restart the application.",
280 281
         "goToStore": "Go to the webstore",
281 282
         "externalInstallationTitle": "Extension required",
282 283
         "externalInstallationMsg": "You need to install our desktop sharing extension."

+ 4
- 3
modules/UI/UI.js Просмотреть файл

@@ -1443,12 +1443,13 @@ UI.showDeviceErrorDialog = function (micError, cameraError) {
1443 1443
 
1444 1444
 /**
1445 1445
  * Shows error dialog that informs the user that no data is received from the
1446
- * microphone.
1446
+ * device.
1447 1447
  */
1448
-UI.showAudioNotWorkingDialog = function () {
1448
+UI.showTrackNotWorkingDialog = function (stream) {
1449 1449
     messageHandler.openMessageDialog(
1450 1450
         "dialog.error",
1451
-        "dialog.micNotSendingData",
1451
+        stream.isAudioTrack()? "dialog.micNotSendingData" :
1452
+            "dialog.cameraNotSendingData",
1452 1453
         null,
1453 1454
         null);
1454 1455
 };

Загрузка…
Отмена
Сохранить