Fixes problems with Temasys plugin support in Safari.

This commit is contained in:
paweldomas 2015-07-22 13:57:54 +02:00
parent 9b4ee7c0c5
commit 0902cbb164
5 changed files with 15 additions and 9 deletions

View File

@ -234,8 +234,8 @@ function RTCUtils(RTCService, onTemasysPluginReady)
// Detect IE/Safari
else if (RTCBrowserType.isTemasysPluginUsed()) {
AdapterJS.WebRTCPlugin.setLogLevel(
AdapterJS.WebRTCPlugin.PLUGIN_LOG_LEVELS.VERBOSE);
//AdapterJS.WebRTCPlugin.setLogLevel(
// AdapterJS.WebRTCPlugin.PLUGIN_LOG_LEVELS.VERBOSE);
AdapterJS.webRTCReady(function (isPlugin) {

View File

@ -299,8 +299,13 @@ var LargeVideo = {
// or null.
this.eventEmitter.emit(UIEvents.SELECTED_ENDPOINT, resourceJid);
}
if (RTCBrowserType.isSafari()) {
// FIXME In Safari fadeOut works only for the first time
changeVideo(this.isLargeVideoVisible());
} else {
$('#largeVideo').fadeOut(300,
changeVideo.bind($('#largeVideo'), this.isLargeVideoVisible()));
}
} else {
if (currentSmallVideo) {
currentSmallVideo.showAvatar();

View File

@ -165,7 +165,7 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream, isVideo, id)
this.VideoLayout.updateRemovedVideo(this.getResourceJid());
};
RemoteVideo.prototype.waitForPlayback = function (stream) {
RemoteVideo.prototype.waitForPlayback = function (sel, stream) {
var isVideo = stream.getVideoTracks().length > 0;
if (!isVideo || stream.id === 'mixedmslabel') {
@ -174,7 +174,6 @@ RemoteVideo.prototype.waitForPlayback = function (stream) {
var self = this;
var resourceJid = this.getResourceJid();
var sel = this.VideoLayout.getPeerVideoSel(resourceJid);
// Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
// when video playback starts
@ -213,7 +212,7 @@ RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
// If the container is currently visible we attach the stream.
if (!isVideo || (this.container.offsetParent !== null && isVideo)) {
this.waitForPlayback(stream);
this.waitForPlayback(sel, stream);
APP.RTC.attachMediaStream(sel, stream);
}

View File

@ -715,7 +715,7 @@ var VideoLayout = (function (my) {
updateLargeVideo = false;
}
remoteVideos[resourceJid].waitForPlayback(mediaStream.stream);
remoteVideos[resourceJid].waitForPlayback(sel, mediaStream.stream);
}
});
}

View File

@ -2,6 +2,7 @@
* Provides statistics for the local stream.
*/
var RTCBrowserType = require('../RTC/RTCBrowserType');
/**
* Size of the webaudio analizer buffer.
@ -84,7 +85,8 @@ function LocalStatsCollector(stream, interval, statisticsService, eventEmitter)
* Starts the collecting the statistics.
*/
LocalStatsCollector.prototype.start = function () {
if (config.disableAudioLevels || !window.AudioContext)
if (config.disableAudioLevels || !window.AudioContext
|| RTCBrowserType.isTemasysPluginUsed())
return;
var context = new AudioContext();