From 826893ad65d1ddaa73ed83a5a4902666ec2b2be3 Mon Sep 17 00:00:00 2001 From: Jose Pereira Date: Wed, 3 Feb 2016 12:16:12 -0800 Subject: [PATCH 1/2] Bugfix retain on pluginMediaStreamTrack will not allow camera/mic to be freed --- src/iosrtcPlugin.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iosrtcPlugin.swift b/src/iosrtcPlugin.swift index ec25f1bc..dcd6ac22 100644 --- a/src/iosrtcPlugin.swift +++ b/src/iosrtcPlugin.swift @@ -550,7 +550,7 @@ class iosrtcPlugin : CDVPlugin { NSLog("iosrtcPlugin#MediaStreamTrack_setListener()") let id = command.argumentAtIndex(0) as! String - let pluginMediaStreamTrack = self.pluginMediaStreamTracks[id] + weak var pluginMediaStreamTrack = self.pluginMediaStreamTracks[id] if pluginMediaStreamTrack == nil { NSLog("iosrtcPlugin#MediaStreamTrack_setListener() | ERROR: pluginMediaStreamTrack with id=\(id) does not exist") From 5273ed4be9a5d2c6247c7ebaf411c201a5d738dc Mon Sep 17 00:00:00 2001 From: Jose Pereira Date: Thu, 4 Feb 2016 15:28:38 -0800 Subject: [PATCH 2/2] Bugfix _iosrtcVideoHandled flag when removing node --- dist/cordova-plugin-iosrtc.js | 1 + js/videoElementsHandler.js | 1 + 2 files changed, 2 insertions(+) diff --git a/dist/cordova-plugin-iosrtc.js b/dist/cordova-plugin-iosrtc.js index 64ea5bca..ba5531c5 100644 --- a/dist/cordova-plugin-iosrtc.js +++ b/dist/cordova-plugin-iosrtc.js @@ -2436,6 +2436,7 @@ var debug = require('debug')('iosrtc:videoElementsHandler'), // If this video element was previously handling a MediaStreamRenderer, release it. releaseMediaStreamRenderer(node); + delete node._iosrtcVideoHandled; } else { for (j = 0; j < node.childNodes.length; j++) { childNode = node.childNodes.item(j); diff --git a/js/videoElementsHandler.js b/js/videoElementsHandler.js index 060aea99..9b9a5c13 100644 --- a/js/videoElementsHandler.js +++ b/js/videoElementsHandler.js @@ -114,6 +114,7 @@ var debug = require('debug')('iosrtc:videoElementsHandler'), // If this video element was previously handling a MediaStreamRenderer, release it. releaseMediaStreamRenderer(node); + delete node._iosrtcVideoHandled; } else { for (j = 0; j < node.childNodes.length; j++) { childNode = node.childNodes.item(j);