-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #575 from QuickBlox/development
Development
- Loading branch information
Showing
296 changed files
with
6,682 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<!DOCTYPE HTML> | ||
|
||
<html> | ||
|
||
<body> | ||
<h1 id="toc_0">Quickblox Android WebRTC Conference documentation.</h1> | ||
|
||
<p>This project provides a brand new way for Quickblox WebRTC users to take part in video chats. | ||
That means the user can create a dialog, add occupants there and join to it for video communication.</p> | ||
|
||
<h2 id="toc_1">Getting started.</h2> | ||
|
||
<p>Integrate QuickBlox Conference sdk in your application. | ||
For using conference chat based on WEBRTC technology in your app, you must add dependency:</p> | ||
|
||
<div><pre><code class="language-java">compile "com.quickblox:quickblox-android-sdk-conference:3.8.1"</code></pre></div> | ||
|
||
<p>The next params can be set before start conference.</p> | ||
|
||
<p><strong>ConferenceConfig</strong> class contains settings for conference:</p> | ||
|
||
<div><pre><code class="language-java">ConferenceConfig.setPlugin(""); | ||
ConferenceConfig.setProtocol(""); | ||
ConferenceConfig.setUrl("");</code></pre></div> | ||
|
||
<p>Sign in user, create <strong>QBDialogType.GROUP</strong> dialog with users you want to join and create conference session:</p> | ||
|
||
<div><pre><code class="language-java">ConferenceClient client = ConferenceClient.getInstance(getApplicationContext()); | ||
|
||
// Create session with Video or Audio type conference | ||
QBRTCTypes.QBConferenceType conferenceType = isVideoCall | ||
? QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO | ||
: QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_AUDIO; | ||
|
||
client.createSession(userID, conferenceType, new ConferenceEntityCallback<ConferenceSession>() { | ||
@Override | ||
public void onSuccess(ConferenceSession session) { | ||
CallActivity.start(context, dialogID); | ||
} | ||
|
||
});</code></pre></div> | ||
|
||
<p><strong>ConferenceClient</strong> instance - is a client model responsible for managing Conference session.</p> | ||
|
||
<p>ConferenceClient has <strong>setAutoSubscribeAfterJoin</strong> option, which means your client will be subscribing to all online publisher after join to room. </p> | ||
|
||
<p><strong>ConferenceSession</strong> - is a session with certain Dialog, managing all current processes. </p> | ||
|
||
<p>Prepare your activity class to join in video room.</p> | ||
|
||
<p>In order to have an ability to receive callbacks about current <strong>ConferenceSession</strong> instance state and conference events, you must implement appropriate interfaces:</p> | ||
|
||
<p>For tracking connection state implement <strong>QBRTCSessionStateCallback</strong>:</p> | ||
|
||
<div><pre><code class="language-java">currentSession.addSessionCallbacksListener(this); | ||
currentSession.removeSessionCallbacksListener(this); | ||
<br> | ||
/** | ||
* Called when session state is changed | ||
*/ | ||
void onStateChanged(ConferenceSession session, BaseSession.QBRTCSessionState state); | ||
<br> | ||
|
||
/** | ||
*Called in case when connection with opponent is established | ||
*/ | ||
void onConnectedToUser(ConferenceSession session, Integer userID); | ||
|
||
<br> | ||
/** | ||
* Called in case when opponent disconnected | ||
*/ | ||
void onDisconnectedFromUser(ConferenceSession session, Integer userID); | ||
|
||
<br> | ||
/** | ||
* Called in case when connection closed with certain user. | ||
*/ | ||
void onConnectionClosedForUser(ConferenceSession session, Integer userID);</code></pre></div> | ||
|
||
<p>For tracking conference events implement <strong>ConferenceSessionCallbacks</strong>:</p> | ||
|
||
<div><pre><code class="language-java">currentSession.addConferenceSessionListener(this); | ||
currentSession.removeConferenceSessionListener(this); | ||
|
||
<br> | ||
/** | ||
* Called when some publisher - is a user, joined to the video room | ||
*/ | ||
void onPublishersReceived(ArrayList<Integer> publishers); | ||
|
||
<br> | ||
/** | ||
* Called when some publisher left room | ||
*/ | ||
void onPublisherLeft(Integer userID); | ||
|
||
<br> | ||
/** | ||
* Called when Media - audio or video type is received | ||
*/ | ||
void onMediaReceived(String type, boolean success); | ||
|
||
<br> | ||
/** | ||
* Called when slowLink is received. SlowLink with uplink=true means you notified several missing packets from server, | ||
* while uplink=false means server is not receiving all your packets. | ||
*/ | ||
void onSlowLinkReceived(boolean uplink, int nacks); | ||
|
||
<br> | ||
/** | ||
* Called when received errors from server | ||
*/ | ||
void onError(String error); | ||
|
||
<br> | ||
/** | ||
* Called when ConferenceSession is closed | ||
*/ | ||
void onSessionClosed(ConferenceSession session);</code></pre></div> | ||
|
||
<p>For obtaining video and audio tracks implement interface <strong>QBRTCClientVideoTracksCallbacks</strong> and <strong>QBRTCClientAudioTracksCallbackRender</strong>. | ||
For setting video track - the <strong>QBConferenceSurfaceView</strong> class is provided.</p> | ||
|
||
<p><strong>Join to the room.</strong> | ||
|
||
<p>You can join to room as a listener or as a publisher. As listener you subscribe only to the publishers, not giving own video and audio streams.</p> | ||
|
||
<div><pre><code class="language-java">QBConferenceRole conferenceRole = asListenerRole ? QBConferenceRole.LISTENER : QBConferenceRole.PUBLISHER;</code></pre></div> | ||
|
||
<div><pre><code class="language-java">currentSession.joinDialog(dialogID, conferenceRole, new QBEntityCallback<ArrayList<Integer>>());</code></pre></div> | ||
|
||
<p>For subscribing to the active publisher: | ||
<code>java | ||
currentSession.subscribeToPublisher(publisherId); | ||
</code></p> | ||
|
||
<p>Note: You should subscribe to publishers only when session state becomes <strong>“connected”</strong>. Use <strong>“onStateChanged”</strong> callback method to track session states, as described in <strong>“sample-videochat-conference”</strong> code sample. | ||
<br>If you are listener, then you can subscribe to publishers right after successful joinDialog.</br></p> | ||
|
||
<p>For unsubscribing from publisher: </p> | ||
|
||
<div><pre><code class="language-java">currentSession.unSubscribeFromPublisher(publisherId);</code></pre></div> | ||
|
||
<p>To leave session: </p> | ||
|
||
<div><pre><code class="language-java">currentSession.leave();</code></pre></div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
buildscript { | ||
repositories { | ||
maven { url 'https://maven.fabric.io/public' } | ||
} | ||
|
||
dependencies { | ||
classpath 'io.fabric.tools:gradle:1.25.1' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'io.fabric' | ||
|
||
repositories { | ||
maven { url 'https://maven.fabric.io/public' } | ||
} | ||
|
||
android { | ||
compileSdkVersion rootProject.compileSdkVersion | ||
buildToolsVersion rootProject.buildToolsVersion | ||
flavorDimensions rootProject.dimensionDefault | ||
|
||
defaultConfig { | ||
applicationId "com.quickblox.sample.conference" | ||
minSdkVersion 16 | ||
targetSdkVersion rootProject.targetSdkVersion | ||
versionCode 223 | ||
versionName "1.0.23" | ||
|
||
// ext.betaDistrubutionGroupAliases=testers_group_name | ||
// ext.betaDistributionEmails=testers_emails | ||
} | ||
|
||
productFlavors { | ||
speedDev { | ||
dimension rootProject.dimensionDefault | ||
minSdkVersion 21 | ||
} | ||
dev { | ||
dimension rootProject.dimensionDefault | ||
minSdkVersion 16 | ||
} | ||
} | ||
|
||
|
||
buildTypes { | ||
debug { | ||
resValue "string", "versionName", "QuickBlox WebRTC\nBuild version " + defaultConfig.getVersionName() | ||
signingConfig signingConfigs.debug | ||
} | ||
|
||
release { | ||
resValue "string", "versionName", "QuickBlox WebRTC\nBuild version " + defaultConfig.getVersionName() | ||
signingConfig signingConfigs.debug | ||
} | ||
} | ||
|
||
signingConfigs { | ||
debug { | ||
storeFile file("../cert/debug.keystore") | ||
storePassword "android" | ||
keyAlias "androiddebugkey" | ||
keyPassword "android" | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "com.quickblox:quickblox-android-sdk-conference:$rootProject.qbSdkVersion" | ||
implementation project(':sample-core') | ||
implementation 'com.android.support:recyclerview-v7:24.0.0' | ||
implementation 'com.android.support:cardview-v7:24.0.0' | ||
implementation "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}" | ||
implementation "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}@aar" | ||
implementation ("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}@aar") { | ||
transitive = true; | ||
} | ||
implementation 'com.github.bumptech.glide:glide:3.6.1' | ||
} | ||
|
||
apply from: "../artifacts.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. | ||
#Wed Mar 25 11:57:04 GMT+02:00 2015 | ||
apiSecret=343e58f13448a59778de3a8f630a0bd4a03803d1ae397818fbe2e76c66d09398 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Users\Roman\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Oops, something went wrong.