Skip to content

Commit a3a5624

Browse files
author
cloudwebrtc
committed
First commit.
1 parent 17c1f3f commit a3a5624

File tree

66 files changed

+2803
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2803
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
# flutter-webrtc-demo
2-
Demo for flutter-webrtc
1+
# flutter_webrtc_demo
2+
3+
A new Flutter application.
4+
5+
## Getting Started
6+
7+
For help getting started with Flutter, view our online
8+
[documentation](https://flutter.io/).

android/app/build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26+
27+
android {
28+
compileSdkVersion 27
29+
30+
lintOptions {
31+
disable 'InvalidPackage'
32+
}
33+
34+
defaultConfig {
35+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36+
applicationId "com.cloudwebrtc.flutterwebrtcdemo"
37+
minSdkVersion 21
38+
targetSdkVersion 27
39+
versionCode flutterVersionCode.toInteger()
40+
versionName flutterVersionName
41+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42+
}
43+
44+
buildTypes {
45+
release {
46+
// TODO: Add your own signing config for the release build.
47+
// Signing with the debug keys for now, so `flutter run --release` works.
48+
signingConfig signingConfigs.debug
49+
}
50+
}
51+
}
52+
53+
flutter {
54+
source '../..'
55+
}
56+
57+
dependencies {
58+
testImplementation 'junit:junit:4.12'
59+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.cloudwebrtc.flutterwebrtcdemo">
3+
4+
<!-- The INTERNET permission is required for development. Specifically,
5+
flutter needs it to communicate with the running application
6+
to allow setting breakpoints, to provide hot reload, etc.
7+
-->
8+
<uses-permission android:name="android.permission.INTERNET"/>
9+
<uses-feature android:name="android.hardware.camera" />
10+
<uses-feature android:name="android.hardware.camera.autofocus" />
11+
<uses-permission android:name="android.permission.CAMERA" />
12+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
13+
<uses-permission android:name="android.permission.WAKE_LOCK" />
14+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
15+
<uses-permission android:name="android.permission.BLUETOOTH" />
16+
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
17+
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
18+
19+
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
20+
calls FlutterMain.startInitialization(this); in its onCreate method.
21+
In most cases you can leave this as-is, but you if you want to provide
22+
additional functionality it is fine to subclass or reimplement
23+
FlutterApplication and put your custom class here. -->
24+
<application
25+
android:name="io.flutter.app.FlutterApplication"
26+
android:label="flutter_webrtc_demo"
27+
android:icon="@mipmap/ic_launcher">
28+
<activity
29+
android:name=".MainActivity"
30+
android:launchMode="singleTop"
31+
android:theme="@style/LaunchTheme"
32+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
33+
android:hardwareAccelerated="true"
34+
android:windowSoftInputMode="adjustResize">
35+
<!-- This keeps the window background of the activity showing
36+
until Flutter renders its first frame. It can be removed if
37+
there is no splash screen (such as the default splash screen
38+
defined in @style/LaunchTheme). -->
39+
<meta-data
40+
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
41+
android:value="true" />
42+
<intent-filter>
43+
<action android:name="android.intent.action.MAIN"/>
44+
<category android:name="android.intent.category.LAUNCHER"/>
45+
</intent-filter>
46+
</activity>
47+
</application>
48+
</manifest>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.cloudwebrtc.flutterwebrtcdemo;
2+
3+
import android.os.Bundle;
4+
import io.flutter.app.FlutterActivity;
5+
import io.flutter.plugins.GeneratedPluginRegistrant;
6+
7+
public class MainActivity extends FlutterActivity {
8+
@Override
9+
protected void onCreate(Bundle savedInstanceState) {
10+
super.onCreate(savedInstanceState);
11+
GeneratedPluginRegistrant.registerWith(this);
12+
}
13+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package io.flutter.plugins;
2+
3+
import io.flutter.plugin.common.PluginRegistry;
4+
import com.cloudwebrtc.webrtc.FlutterWebRTCPlugin;
5+
import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin;
6+
7+
/**
8+
* Generated file. Do not edit.
9+
*/
10+
public final class GeneratedPluginRegistrant {
11+
public static void registerWith(PluginRegistry registry) {
12+
if (alreadyRegisteredWith(registry)) {
13+
return;
14+
}
15+
FlutterWebRTCPlugin.registerWith(registry.registrarFor("com.cloudwebrtc.webrtc.FlutterWebRTCPlugin"));
16+
SharedPreferencesPlugin.registerWith(registry.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"));
17+
}
18+
19+
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
20+
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
21+
if (registry.hasPlugin(key)) {
22+
return true;
23+
}
24+
registry.registrarFor(key);
25+
return false;
26+
}
27+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Loading
Loading
Loading
Loading
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
4+
<!-- Show a splash screen on the activity. Automatically removed when
5+
Flutter draws its first frame -->
6+
<item name="android:windowBackground">@drawable/launch_background</item>
7+
</style>
8+
</resources>

android/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
jcenter()
5+
}
6+
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:3.1.2'
9+
}
10+
}
11+
12+
allprojects {
13+
repositories {
14+
google()
15+
jcenter()
16+
}
17+
}
18+
19+
rootProject.buildDir = '../build'
20+
subprojects {
21+
project.buildDir = "${rootProject.buildDir}/${project.name}"
22+
}
23+
subprojects {
24+
project.evaluationDependsOn(':app')
25+
}
26+
27+
task clean(type: Delete) {
28+
delete rootProject.buildDir
29+
}

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.jvmargs=-Xmx1536M

android/settings.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
include ':app'
2+
3+
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4+
5+
def plugins = new Properties()
6+
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7+
if (pluginsFile.exists()) {
8+
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9+
}
10+
11+
plugins.each { name, path ->
12+
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13+
include ":$name"
14+
project(":$name").projectDir = pluginDirectory
15+
}

flutter_webrtc_demo.iml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android" name="Android">
5+
<configuration />
6+
</facet>
7+
</component>
8+
<component name="NewModuleRootManager" inherit-compiler-output="true">
9+
<exclude-output />
10+
<content url="file://$MODULE_DIR$">
11+
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
12+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
13+
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
14+
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
15+
<excludeFolder url="file://$MODULE_DIR$/.idea" />
16+
<excludeFolder url="file://$MODULE_DIR$/.pub" />
17+
<excludeFolder url="file://$MODULE_DIR$/build" />
18+
</content>
19+
<orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
20+
<orderEntry type="sourceFolder" forTests="false" />
21+
<orderEntry type="library" name="Dart SDK" level="project" />
22+
<orderEntry type="library" name="Flutter Plugins" level="project" />
23+
<orderEntry type="library" name="Dart Packages" level="project" />
24+
</component>
25+
</module>

flutter_webrtc_demo_android.iml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android" name="Android">
5+
<configuration>
6+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
7+
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/android/gen" />
8+
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/android/gen" />
9+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/android/AndroidManifest.xml" />
10+
<option name="RES_FOLDER_RELATIVE_PATH" value="/android/res" />
11+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/android/assets" />
12+
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/android/libs" />
13+
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/android/proguard_logs" />
14+
</configuration>
15+
</facet>
16+
</component>
17+
<component name="NewModuleRootManager" inherit-compiler-output="true">
18+
<exclude-output />
19+
<content url="file://$MODULE_DIR$/android">
20+
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
21+
<sourceFolder url="file://$MODULE_DIR$/android/gen" isTestSource="false" generated="true" />
22+
</content>
23+
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
24+
<orderEntry type="sourceFolder" forTests="false" />
25+
<orderEntry type="library" name="Flutter for Android" level="project" />
26+
</component>
27+
</module>

ios/Flutter/AppFrameworkInfo.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>App</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>io.flutter.flutter.app</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>App</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>MinimumOSVersion</key>
24+
<string>8.0</string>
25+
</dict>
26+
</plist>

ios/Flutter/Debug.xcconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "Generated.xcconfig"

ios/Podfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
def parse_KV_file(file, separator='=')
8+
file_abs_path = File.expand_path(file)
9+
if !File.exists? file_abs_path
10+
return [];
11+
end
12+
pods_ary = []
13+
skip_line_start_symbols = ["#", "/"]
14+
File.foreach(file_abs_path) { |line|
15+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
16+
plugin = line.split(pattern=separator)
17+
if plugin.length == 2
18+
podname = plugin[0].strip()
19+
path = plugin[1].strip()
20+
podpath = File.expand_path("#{path}", file_abs_path)
21+
pods_ary.push({:name => podname, :path => podpath});
22+
else
23+
puts "Invalid plugin specification: #{line}"
24+
end
25+
}
26+
return pods_ary
27+
end
28+
29+
target 'Runner' do
30+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
31+
# referring to absolute paths on developers' machines.
32+
system('rm -rf .symlinks')
33+
system('mkdir -p .symlinks/plugins')
34+
35+
# Flutter Pods
36+
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
37+
if generated_xcode_build_settings.empty?
38+
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
39+
end
40+
generated_xcode_build_settings.map { |p|
41+
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
42+
symlink = File.join('.symlinks', 'flutter')
43+
File.symlink(File.dirname(p[:path]), symlink)
44+
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
45+
end
46+
}
47+
48+
# Plugin Pods
49+
plugin_pods = parse_KV_file('../.flutter-plugins')
50+
plugin_pods.map { |p|
51+
symlink = File.join('.symlinks', 'plugins', p[:name])
52+
File.symlink(p[:path], symlink)
53+
pod p[:name], :path => File.join(symlink, 'ios')
54+
}
55+
end
56+
57+
post_install do |installer|
58+
installer.pods_project.targets.each do |target|
59+
target.build_configurations.each do |config|
60+
config.build_settings['ENABLE_BITCODE'] = 'NO'
61+
end
62+
end
63+
end

0 commit comments

Comments
 (0)