Skip to content

Commit

Permalink
Merge pull request #318 from opentok/0.12.0
Browse files Browse the repository at this point in the history
0.12.0
  • Loading branch information
ggoldens authored Aug 5, 2019
2 parents c4b526e + 4024e27 commit c135e30
Show file tree
Hide file tree
Showing 24 changed files with 705 additions and 438 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

# 0.12.0 (Aug 5, 2019)

- **[Feature]**: Add Multi-session support (merged from [PR311](https://github.com/opentok/opentok-react-native/pull/311)). Adheres to: [#218](https://github.com/opentok/opentok-react-native/issues/218), [#271](https://github.com/opentok/opentok-react-native/issues/271)


# 0.11.2 (July 2, 2019)

- **[Feature]**: Enable `OTSubscriber` children custom render (merged from [PR306](https://github.com/opentok/opentok-react-native/pull/306)). Adheres to: [#289](https://github.com/opentok/opentok-react-native/issues/289), [#174](https://github.com/opentok/opentok-react-native/issues/174)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ public OTPublisherLayout(ThemedReactContext reactContext) {
public void createPublisherView(String publisherId) {

ConcurrentHashMap<String, Publisher> mPublishers = sharedState.getPublishers();
String pubOrSub = sharedState.getAndroidOnTop();
String zOrder = sharedState.getAndroidZOrder();
ConcurrentHashMap<String, String> androidOnTopMap = sharedState.getAndroidOnTopMap();
ConcurrentHashMap<String, String> androidZOrderMap = sharedState.getAndroidZOrderMap();
String pubOrSub = "";
String zOrder = "";
Publisher mPublisher = mPublishers.get(publisherId);
if (mPublisher != null) {
if (androidOnTopMap.get(mPublisher.getSession().getSessionId()) != null) {
pubOrSub = androidOnTopMap.get(mPublisher.getSession().getSessionId());
}
if (androidZOrderMap.get(mPublisher.getSession().getSessionId()) != null) {
zOrder = androidZOrderMap.get(mPublisher.getSession().getSessionId());
}
mPublisher.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE,
BaseVideoRenderer.STYLE_VIDEO_FILL);
FrameLayout mPublisherViewContainer = new FrameLayout(getContext());
Expand Down
52 changes: 24 additions & 28 deletions android/src/main/java/com/opentokreactnative/OTRN.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
public class OTRN {

public static OTRN sharedState;
private Session mSession;
private String mAndroidOnTop;
private String mAndroidZOrder;

private ConcurrentHashMap<String, Stream> subscriberStreams = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Subscriber> subscribers = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Publisher> publishers = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Session> sessions = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, String> androidOnTopMap = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, String> androidZOrderMap = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, FrameLayout> subscriberViewContainers = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, FrameLayout> publisherViewContainers = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Callback> publisherDestroyedCallbacks = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Callback> sessionConnectCallbacks = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Callback> sessionDisconnectCallbacks = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Connection> connections = new ConcurrentHashMap<>();

public static synchronized OTRN getSharedState() {
Expand All @@ -38,37 +40,16 @@ public static synchronized OTRN getSharedState() {
return sharedState;
}

public synchronized Session getSession() {
public ConcurrentHashMap<String, String> getAndroidOnTopMap() {

return this.mSession;
return this.androidOnTopMap;
}

public synchronized void setSession(Session mSession) {
public ConcurrentHashMap<String, String> getAndroidZOrderMap() {

this.mSession = mSession;
return this.androidZOrderMap;
}

public synchronized String getAndroidOnTop() {

return this.mAndroidOnTop;
}

public synchronized void setAndroidOnTop(String androidOnTop) {

this.mAndroidOnTop = androidOnTop;
}

public synchronized String getAndroidZOrder() {

return this.mAndroidZOrder;
}

public synchronized void setAndroidZOrder(String androidZOrder) {

this.mAndroidZOrder = androidZOrder;
}


public ConcurrentHashMap<String, Stream> getSubscriberStreams() {

return this.subscriberStreams;
Expand Down Expand Up @@ -99,10 +80,25 @@ public ConcurrentHashMap<String, Callback> getPublisherDestroyedCallbacks() {
return this.publisherDestroyedCallbacks;
}

public ConcurrentHashMap<String, Callback> getSessionConnectCallbacks() {

return this.sessionConnectCallbacks;
}

public ConcurrentHashMap<String, Callback> getSessionDisconnectCallbacks() {

return this.sessionDisconnectCallbacks;
}

public ConcurrentHashMap<String, Connection> getConnections() {

return this.connections;
}

public ConcurrentHashMap<String, Session> getSessions() {

return this.sessions;
}

private OTRN() {}
}
Loading

0 comments on commit c135e30

Please sign in to comment.