Skip to content

Commit

Permalink
Merge pull request #575 from QuickBlox/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
RomanPronin authored Apr 3, 2018
2 parents 9fc30d4 + 2fd2538 commit d893eb8
Show file tree
Hide file tree
Showing 296 changed files with 6,682 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ ext {

// QuickBlox SDK version
qbChatAdapterVersion = '2.0'
qbSdkVersion = '3.8.0'
qbSdkVersion = '3.8.1'

versionCode = 380
versionName = '3.8.0'
versionCode = 381
versionName = '3.8.1'

testRunnerVersion = "0.4.1"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Sep 09 11:44:11 GMT+02:00 2016
#Thu Oct 26 17:44:23 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CoreApp extends Application {

private static CoreApp instance;
private static final String QB_CONFIG_DEFAULT_FILE_NAME = "qb_config.json";
private QbConfigs qbConfigs;
protected QbConfigs qbConfigs;

@Override
public void onCreate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.io.Serializable;

public class QbConfigs implements Serializable{
public class QbConfigs implements Serializable {

public QbConfigs() {
}
Expand All @@ -30,6 +30,8 @@ public QbConfigs() {
@SerializedName("gcm_sender_id")
private String gcmSenderId;

@SerializedName("janus_server_url")
private String janusServerUrl;

public String getAppId() {
return appId;
Expand Down Expand Up @@ -87,4 +89,11 @@ public void setGcmSenderId(String gcmSenderId) {
this.gcmSenderId = gcmSenderId;
}

public String getJanusServerUrl() {
return janusServerUrl;
}

public void setJanusServerUrl(String janusServerUrl) {
this.janusServerUrl = janusServerUrl;
}
}
1 change: 1 addition & 0 deletions sample-videochat-conference/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
152 changes: 152 additions & 0 deletions sample-videochat-conference/README.md
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 &quot;com.quickblox:quickblox-android-sdk-conference:3.8.1&quot;</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(&quot;&quot;);
ConferenceConfig.setProtocol(&quot;&quot;);
ConferenceConfig.setUrl(&quot;&quot;);</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&lt;Integer&gt; 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&lt;ArrayList&lt;Integer&gt;&gt;());</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>
90 changes: 90 additions & 0 deletions sample-videochat-conference/build.gradle
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"
3 changes: 3 additions & 0 deletions sample-videochat-conference/fabric.properties
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
25 changes: 25 additions & 0 deletions sample-videochat-conference/proguard-rules.pro
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
Loading

0 comments on commit d893eb8

Please sign in to comment.