Skip to content

Commit

Permalink
Merge pull request cordova-rtc#159 from Switch168/patch-2
Browse files Browse the repository at this point in the history
iOS-Cordova 4 support
  • Loading branch information
ibc committed Apr 14, 2016
2 parents 02a8b82 + 5abcdea commit fcca647
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In order to make this Cordova plugin run into a iOS application some requirement

* Xcode >= 7.2.1
* iOS >= 9 (run on lower versions at your own risk, but don't open issues)
* `cordova-ios` 3.9.X (don't attempt to use 4.X)
* `cordova-ios` 4.X
* No bitcode (built-in *libwebrtc* does not contain bitcode so you need to disable it in your Xcode project settings)


Expand Down
4 changes: 2 additions & 2 deletions src/PluginMediaStreamRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AVFoundation


class PluginMediaStreamRenderer : NSObject, RTCEAGLVideoViewDelegate {
var webView: UIWebView
var webView: UIView
var eventListener: (data: NSDictionary) -> Void
var elementView: UIView
var videoView: RTCEAGLVideoView
Expand All @@ -13,7 +13,7 @@ class PluginMediaStreamRenderer : NSObject, RTCEAGLVideoViewDelegate {


init(
webView: UIWebView,
webView: UIView,
eventListener: (data: NSDictionary) -> Void
) {
NSLog("PluginMediaStreamRenderer#init()")
Expand Down
16 changes: 11 additions & 5 deletions src/iosrtcPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,27 @@ class iosrtcPlugin : CDVPlugin {
// Single PluginGetUserMedia instance.
var pluginGetUserMedia: PluginGetUserMedia!
// PluginRTCPeerConnection dictionary.
var pluginRTCPeerConnections: [Int : PluginRTCPeerConnection] = [:]
var pluginRTCPeerConnections: [Int : PluginRTCPeerConnection]!
// PluginMediaStream dictionary.
var pluginMediaStreams: [String : PluginMediaStream] = [:]
var pluginMediaStreams: [String : PluginMediaStream]!
// PluginMediaStreamTrack dictionary.
var pluginMediaStreamTracks: [String : PluginMediaStreamTrack] = [:]
var pluginMediaStreamTracks: [String : PluginMediaStreamTrack]!
// PluginMediaStreamRenderer dictionary.
var pluginMediaStreamRenderers: [Int : PluginMediaStreamRenderer] = [:]
var pluginMediaStreamRenderers: [Int : PluginMediaStreamRenderer]!
// Dispatch queue for serial operations.
let queue = dispatch_queue_create("cordova-plugin-iosrtc", DISPATCH_QUEUE_SERIAL)
var queue: dispatch_queue_t!


// This is just called if <param name="onload" value="true" /> in plugin.xml.
override func pluginInitialize() {
NSLog("iosrtcPlugin#pluginInitialize()")

pluginMediaStreams = [:]
pluginMediaStreamTracks = [:]
pluginMediaStreamRenderers = [:]
queue = dispatch_queue_create("cordova-plugin-iosrtc", DISPATCH_QUEUE_SERIAL)
pluginRTCPeerConnections = [:]

// Initialize DTLS stuff.
RTCPeerConnectionFactory.initializeSSL()

Expand Down

0 comments on commit fcca647

Please sign in to comment.