Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS-Cordova 4 support #159

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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