Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Xcode
build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -18,6 +19,8 @@ profile
DerivedData
*.hmap
*.ipa
.swiftpm/
Package.resolved

# Bundler
.bundle
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ language: objective-c
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/WKWebViewRTC.xcworkspace -scheme WKWebViewRTC-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint --allow-warnings
6 changes: 0 additions & 6 deletions Example/Podfile

This file was deleted.

87 changes: 12 additions & 75 deletions Example/WKWebViewRTC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
7EE10A56265802BC002106AB /* WKWebViewRTC_ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE10A55265802BC002106AB /* WKWebViewRTC_ExampleTests.swift */; };
C66545EAFAA6C35DB6CA2184 /* Pods_WKWebViewRTC_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */; };

/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -28,8 +28,7 @@

/* Begin PBXFileReference section */
081BDE7624D12628001896C7 /* WKWebViewRTC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = WKWebViewRTC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0BBF29669602AC4D9879027C /* Pods-WKWebViewRTC_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Tests.debug.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Tests/Pods-WKWebViewRTC_Tests.debug.xcconfig"; sourceTree = "<group>"; };
30FBF30DE83E0C823AB35DF3 /* Pods-WKWebViewRTC_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Tests.release.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Tests/Pods-WKWebViewRTC_Tests.release.xcconfig"; sourceTree = "<group>"; };

607FACD01AFB9204008FA782 /* WKWebViewRTC_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WKWebViewRTC_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -41,19 +40,17 @@
7EE10A55265802BC002106AB /* WKWebViewRTC_ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKWebViewRTC_ExampleTests.swift; sourceTree = "<group>"; };
7EE10A57265802BC002106AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8AEFE6B0E7BA7E2E33BE4AAE /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
A0EDBD4CCC0BEDDAEE236367 /* Pods-WKWebViewRTC_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Example.release.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example.release.xcconfig"; sourceTree = "<group>"; };
B35BA54F2CDD708693E71D05 /* WKWebViewRTC.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = WKWebViewRTC.podspec; path = ../WKWebViewRTC.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKWebViewRTC_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };

DB050538E6A08CA58E6DAF4E /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
EE6CE03A4ED4077B0CE8B3D6 /* Pods-WKWebViewRTC_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Example.debug.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example.debug.xcconfig"; sourceTree = "<group>"; };

/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
607FACCD1AFB9204008FA782 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C66545EAFAA6C35DB6CA2184 /* Pods_WKWebViewRTC_Example.framework in Frameworks */,

);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -70,11 +67,10 @@
607FACC71AFB9204008FA782 = {
isa = PBXGroup;
children = (
607FACF51AFB993E008FA782 /* Podspec Metadata */,
607FACF51AFB993E008FA782 /* Package Metadata */,
607FACD21AFB9204008FA782 /* Example for WKWebViewRTC */,
7EE10A54265802BC002106AB /* WKWebViewRTC_ExampleTests */,
607FACD11AFB9204008FA782 /* Products */,
7D4535BB2E06396403CCBF10 /* Pods */,
9FCA6F8BBA28C27F5334B33B /* Frameworks */,
);
sourceTree = "<group>";
Expand Down Expand Up @@ -110,25 +106,13 @@
name = "Supporting Files";
sourceTree = "<group>";
};
607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
607FACF51AFB993E008FA782 /* Package Metadata */ = {
isa = PBXGroup;
children = (
B35BA54F2CDD708693E71D05 /* WKWebViewRTC.podspec */,
8AEFE6B0E7BA7E2E33BE4AAE /* README.md */,
DB050538E6A08CA58E6DAF4E /* LICENSE */,
);
name = "Podspec Metadata";
sourceTree = "<group>";
};
7D4535BB2E06396403CCBF10 /* Pods */ = {
isa = PBXGroup;
children = (
EE6CE03A4ED4077B0CE8B3D6 /* Pods-WKWebViewRTC_Example.debug.xcconfig */,
A0EDBD4CCC0BEDDAEE236367 /* Pods-WKWebViewRTC_Example.release.xcconfig */,
0BBF29669602AC4D9879027C /* Pods-WKWebViewRTC_Tests.debug.xcconfig */,
30FBF30DE83E0C823AB35DF3 /* Pods-WKWebViewRTC_Tests.release.xcconfig */,
);
path = Pods;
name = "Package Metadata";
sourceTree = "<group>";
};
7EE10A54265802BC002106AB /* WKWebViewRTC_ExampleTests */ = {
Expand All @@ -144,7 +128,6 @@
isa = PBXGroup;
children = (
081BDE7624D12628001896C7 /* WKWebViewRTC.framework */,
BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -156,11 +139,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "WKWebViewRTC_Example" */;
buildPhases = (
ACD4151662C2B72D1B85D536 /* [CP] Check Pods Manifest.lock */,
607FACCC1AFB9204008FA782 /* Sources */,
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
55107F4E49D480B326A84FA8 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -251,48 +232,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
55107F4E49D480B326A84FA8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example-frameworks.sh",
"${PODS_ROOT}/GoogleWebRTC/Frameworks/frameworks/WebRTC.framework",
"${BUILT_PRODUCTS_DIR}/WKWebViewRTC/WKWebViewRTC.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WKWebViewRTC.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ACD4151662C2B72D1B85D536 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-WKWebViewRTC_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -444,7 +383,6 @@
};
607FACF01AFB9204008FA782 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EE6CE03A4ED4077B0CE8B3D6 /* Pods-WKWebViewRTC_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
Expand All @@ -453,7 +391,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = "com.combined-public-communications.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
Expand All @@ -462,7 +400,6 @@
};
607FACF11AFB9204008FA782 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A0EDBD4CCC0BEDDAEE236367 /* Pods-WKWebViewRTC_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
Expand All @@ -471,7 +408,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = "com.combined-public-communications.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
Expand Down Expand Up @@ -499,7 +436,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.WKWebViewRTC-ExampleTests.WKWebViewRTC-ExampleTests";
PRODUCT_BUNDLE_IDENTIFIER = "com.combined-public-communications.WKWebViewRTC-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -527,7 +464,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.WKWebViewRTC-ExampleTests.WKWebViewRTC-ExampleTests";
PRODUCT_BUNDLE_IDENTIFIER = "com.combined-public-communications.WKWebViewRTC-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
4 changes: 1 addition & 3 deletions Example/WKWebViewRTC.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "WKWebViewRTC",
platforms: [
.iOS(.v13) // Bundle.module requires iOS 13+
],
products: [
.library(
name: "WKWebViewRTC",
targets: ["WKWebViewRTC"]
),
],
dependencies: [
.package(
url: "https://github.com/stasel/WebRTC.git",
.upToNextMajor(from: "125.0.0")
),
],
targets: [
.target(
name: "WKWebViewRTC",
dependencies: [
.product(name: "WebRTC", package: "WebRTC")
],
path: "WKWebViewRTC",
exclude: [
"Assets", // empty, .gitkeep only
"Js/src", // 25 JS source files not needed in binary
"Js/package.json" // Node.js build config, not needed
// Js/.gitignore is a hidden file; SPM ignores it automatically
// Classes/.gitkeep is a hidden file; SPM ignores it automatically
],
sources: ["Classes"],
resources: [
.process("Js/jsWKWebViewRTC.js") // 141 KB compiled JS bridge
]
),
]
)
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# WKWebViewRTC

[![CI Status](https://img.shields.io/travis/JustDoIt9/WKWebViewRTC.svg?style=flat)](https://travis-ci.org/JustDoIt9/WKWebViewRTC)
[![Version](https://img.shields.io/cocoapods/v/WKWebViewRTC.svg?style=flat)](https://cocoapods.org/pods/WKWebViewRTC)
[![License](https://img.shields.io/cocoapods/l/WKWebViewRTC.svg?style=flat)](https://cocoapods.org/pods/WKWebViewRTC)
[![Platform](https://img.shields.io/cocoapods/p/WKWebViewRTC.svg?style=flat)](https://cocoapods.org/pods/WKWebViewRTC)
[![License](https://img.shields.io/github/license/OpenTelecom/WKWebViewRTC.svg?style=flat)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg?style=flat)](https://developer.apple.com/ios/)
[![Swift](https://img.shields.io/badge/Swift-5.9-orange.svg?style=flat)](https://swift.org)

WebRTC library for WKWebView for Swift on iOS (based on cordova-plugin-iosrtc: https://github.com/cordova-rtc/cordova-plugin-iosrtc)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.
To run the example project, clone the repo and open `Example/WKWebViewRTC.xcworkspace` in Xcode. Xcode will resolve the SPM dependencies automatically.

## Requirements

Expand All @@ -21,15 +20,14 @@ In order to make this framework run into a iOS application some requirements mus

## Installation

WKWebViewRTC is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
WKWebViewRTC is available via [Swift Package Manager](https://swift.org/package-manager/). Add it to your project in Xcode via **File → Add Package Dependencies**, or add it to your `Package.swift`:

```ruby
pod 'WKWebViewRTC'
```swift
.package(url: "https://github.com/OpenTelecom/WKWebViewRTC.git", branch: "feature/CPC-12213-update-pod-to-spm")
```

## Dependencies
* [GoogleWebRTC](https://cocoapods.org/pods/GoogleWebRTC) => v1.1.29229
* [stasel/WebRTC](https://github.com/stasel/WebRTC) >= 125.0.0

## Build JS (WKWebViewRTC/Js/jsWKWebViewRTC.js)

Expand Down
38 changes: 0 additions & 38 deletions WKWebViewRTC.podspec

This file was deleted.

2 changes: 1 addition & 1 deletion WKWebViewRTC/Classes/WKWebViewRTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class WKWebViewRTC : NSObject {

setWebView(webview: wkwebview)

if let path = Bundle(for: type(of: self)).path(forResource: "jsWKWebViewRTC", ofType: "js") {
if let path = Bundle.module.path(forResource: "jsWKWebViewRTC", ofType: "js") {
if let bindingJS = try? String(contentsOfFile: path, encoding: .utf8) {
let script = WKUserScript(source: bindingJS, injectionTime: .atDocumentStart, forMainFrameOnly: false)
self.userContentController?.addUserScript(script)
Expand Down
6 changes: 3 additions & 3 deletions WKWebViewRTC/Classes/iMediaStreamRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class iMediaStreamRenderer : NSObject, RTCVideoViewDelegate {
var elementView: UIView
var pluginMediaStream: iMediaStream?

var videoView: RTCEAGLVideoView
var videoView: RTCMTLVideoView
var rtcAudioTrack: RTCAudioTrack?
var rtcVideoTrack: RTCVideoTrack?
var pluginVideoTrack: iMediaStreamTrack?
Expand All @@ -45,7 +45,7 @@ class iMediaStreamRenderer : NSObject, RTCVideoViewDelegate {

// The effective video view in which the the video stream is shown.
// It's placed over the elementView.
self.videoView = RTCEAGLVideoView()
self.videoView = RTCMTLVideoView()
self.videoView.isUserInteractionEnabled = false

self.elementView.isUserInteractionEnabled = false
Expand Down Expand Up @@ -308,7 +308,7 @@ class iMediaStreamRenderer : NSObject, RTCVideoViewDelegate {
}

/**
* Methods inherited from RTCEAGLVideoViewDelegate.
* Methods inherited from RTCVideoViewDelegate (RTCMTLVideoView).
*/

func videoView(_ videoView: RTCVideoRenderer, didChangeVideoSize size: CGSize) {
Expand Down
Loading