SlideShare une entreprise Scribd logo
OpenTok 2.0:
Android SDK
Marina Serrano Montes
marinas@tokbox.com
Contents
1. What is OpenTok ?
2. What is WebRTC ?
3. Why using OpenTok ?
4. OpenTokRTC DEMO
5. SDK for Android platform
6. API for Android SDK
7. New features for Android SDK
8. Others APIs
1. What is OpenTok?
OpenTok is a OTT platform.
It delivers all the global infrastructure,
scalability, and features the developers
need to add WebRTC to their website or
mobile application.
2. What is WebRTC?
- A powerful RTC open source standard. It enables real time
communication through a common set of APIs.
-WebRTC defines a way to implement technologies like video chat in a way that
is interoperable with other clients.
- It is available for different browsers (plugin is not required) and for native iOS
and Android platforms.
- WebRTC vs Flash:
better video quality

faster connections time reduced audio/video latency

- Emerging issue: Video Codec debate: VP8 or H.264?
3. Why using OpenTok?
Infrastructure, APIs and tools to unlock the potential of WebRTC

Fewer lines of
code

Native SDK for
mobiles

Experience
optimization

Archiving &
Playback

Robust
signaling

Web SDK

Interoperability

Global
infrastructure

Firewall
transversal
support

Intelligent
quality controls

Multi-party calls

High
performance
3. Why using OpenTok?
Some customer success stories
4. OpenTokRTC DEMO
5. SDK for Android platform

Overall architecture
6. API for Android SDK
Session

Stream

Publisher

Connection

Subscriber

OpenTokException
6. API for Android SDK
Session

Represents an OpenTok session in which the client is participating

Tasks:
Initializing and connect to a session:
public Session (Context context, String sessionId, Listener listener);
public void connect(final String apiKey, final String token);
public void disconnect();

Getting information about the session:
public Connection getConnection();
6. API for Android SDK
Publishing audio-video stream to a session:
public void publish(Publisher publisher);
public void unpublish(Publisher publisher);

Subscribing audio-video stream:
public void subscribe(Subscriber subscriber);
public void unsubscribe(Subscriber subscriber);
6. API for Android SDK
Callbacks:
public void onSessionConnected(Session session);
public void onSessionDisconnected(Session session);
public void onSessionReceivedStream(Session session, Stream stream);
public void onSessionDroppedStream(Session session, Stream stream);
public void onSessionCreatedConnection(Session session, Connection connection);
public void onSessionDroppedConnection(Session session, Connection connection);
public void onSessionError(Session session, OpentokError error);
6. API for Android SDK
Publisher

Captures an audio-video stream from the device’s microphone
and camera. This stream will be published to an OpenTok session.

Tasks:
Initializing a publisher:
public Publisher (Context context, Listener listener, String name) ;

Getting information about the publisher:
public boolean getPublishVideo();
public boolean getPublishAudio();
public Session getSession();
public String getStreamId();
public int getCameraId();
6. API for Android SDK
Controlling audio and video output for a publisher:
public void setPublishVideo(boolean publishVideo);
public void setPublishAudio(boolean publishAudio);

Setting publisher device configuration:
public void setCameraId(int cameraId);
public void swapCamera();

Callbacks:
public
public
public
public

void
void
void
void

onPublisherStreamingStarted();
onPublisherStreamingStopped();
onPublisherChangedCamera(int newCameraId);
onPublisherException(OpentokException exception);
6. API for Android SDK
Subscriber

Used to consume an audio-video stream in the OpenTok session.

Tasks:
Initializing a subscriber:
public Subscriber (Context context , Stream stream )

Getting information about the publisher:
public boolean getSubscriberToVideo();
public boolean getSubscriberToAudio();
public Session getSession();
public String getStream();
public View getView();
6. API for Android SDK
Controlling audio and video playback:
public void setSubscribeToAudio(boolean subscribeToAudio);
public void setSubscribeToVideo(boolean subscribeToVideo);

Callbacks:
public void onSubscriberConnected(Subscriber subscriber);
public void onSubscriberVideoDisabled(Subscriber subscriber);
public void onSubscriberException(Subscriber subscriber,
OpentokException exception);
6. API for Android SDK
Stream

Represents a stream of multimedia, which may contain video
and/or audio data.

Tasks:
Getting basic information about the stream:
public String getStreamId();
public Date getCreationTime();
public Connection getConnection();
public String getName();

Getting audio and video information about the stream:
public int getVideoWidth();

public boolean hasVideo();

public int getVideoHeight();

public boolean hasAudio();
6. API for Android SDK
Connection

Represents a connection between a client and an OpenTok
session.

Tasks:
Getting information about the connection:
public String getConnectionId();
public Date getCreationTime();
public String getData();
6. API for Android SDK
OpenTokException

Defines errors thrown by the OpenTok
Android SDK.

Basic errors categories:
Network error -- unable to connect to the session: check the network connection.
Authentication error -- unable to connect: an invalid API key or token was
provided.
Internal error
7. New features for Android SDK
For next Android SDK release….
Signaling: Sends a signal to each client or specified clients in the session.
public boolean sendSignal(String type, String data);
public boolean sendSignal(String type, String data, ArrayList<Connection> connections);
Callback: void onSignal(Session session, final String type, final String data, String
connectionId, long creationTimeConnection);

Eg: mSession.sendSignal("chat", "hello");
7. New features for Android SDK
and...
Expose video driver & render: Video comes in and out the SDK.
- Developers can use the video driver and video render by default in the SDK.
or
- Developers can implement their own video driver. Some uses cases:
* Don't use the camera of the device by default....
* sending a picture as captured video…
* adding funny effects to the video….
8. Others APIs
Thank you very much

Contenu connexe

Tendances

What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
mfrancis
 

Tendances (16)

OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plansOpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
JavaCro'15 - Reactive I/O - Ivan Turčinović
JavaCro'15 - Reactive I/O - Ivan TurčinovićJavaCro'15 - Reactive I/O - Ivan Turčinović
JavaCro'15 - Reactive I/O - Ivan Turčinović
 
AOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformAOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java Platform
 
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
 
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.PilgrimJavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
 
NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017
 
Introduction to jython
Introduction to jythonIntroduction to jython
Introduction to jython
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
20120726 aj-mucugl-video-conferencing-capabilities-within-lync-2013
20120726 aj-mucugl-video-conferencing-capabilities-within-lync-201320120726 aj-mucugl-video-conferencing-capabilities-within-lync-2013
20120726 aj-mucugl-video-conferencing-capabilities-within-lync-2013
 
Docker - Der Wal in der Kiste
Docker - Der Wal in der KisteDocker - Der Wal in der Kiste
Docker - Der Wal in der Kiste
 
Delivering High Quality Elixir Code using Gitlab
Delivering High Quality Elixir Code using GitlabDelivering High Quality Elixir Code using Gitlab
Delivering High Quality Elixir Code using Gitlab
 
Functional Reactive Programming in the Netflix API
Functional Reactive Programming in the Netflix APIFunctional Reactive Programming in the Netflix API
Functional Reactive Programming in the Netflix API
 
What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
What’s cool in the new and updated OSGi specs (DS, Cloud and more) - David Bo...
 
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank WierzbickiJython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
 
Get Started with MicroPython ESP32
Get Started with MicroPython ESP32Get Started with MicroPython ESP32
Get Started with MicroPython ESP32
 

En vedette (6)

Facebook Platform for Developers
Facebook Platform for DevelopersFacebook Platform for Developers
Facebook Platform for Developers
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
Getting started with Facebook OpenGraph API
Getting started with Facebook OpenGraph APIGetting started with Facebook OpenGraph API
Getting started with Facebook OpenGraph API
 
Facebook Open Graph API and How To Use It
Facebook Open Graph API and How To Use ItFacebook Open Graph API and How To Use It
Facebook Open Graph API and How To Use It
 
Facebook Open Graph API
Facebook Open Graph APIFacebook Open Graph API
Facebook Open Graph API
 
LaunchPad Presentation of OpenTok
LaunchPad Presentation of OpenTokLaunchPad Presentation of OpenTok
LaunchPad Presentation of OpenTok
 

Similaire à Open tok Android sdk - Droidcon

Similaire à Open tok Android sdk - Droidcon (20)

Webrtc in Real world
Webrtc in Real world Webrtc in Real world
Webrtc in Real world
 
WebRTC Videobroadcasting
WebRTC VideobroadcastingWebRTC Videobroadcasting
WebRTC Videobroadcasting
 
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
 
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
 
WebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the WebWebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the Web
 
Introduction To Webrtc
Introduction To WebrtcIntroduction To Webrtc
Introduction To Webrtc
 
2014 austin-api-sdks-are-apis-too
2014 austin-api-sdks-are-apis-too2014 austin-api-sdks-are-apis-too
2014 austin-api-sdks-are-apis-too
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
 
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
 
WebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computationWebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computation
 
What is OZEKI Camera SDK?
What is OZEKI Camera SDK?What is OZEKI Camera SDK?
What is OZEKI Camera SDK?
 
WebRTC
WebRTCWebRTC
WebRTC
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
 
OSCC20 SceneGate, EchoVoice, and IMABox
OSCC20 SceneGate, EchoVoice, and IMABox OSCC20 SceneGate, EchoVoice, and IMABox
OSCC20 SceneGate, EchoVoice, and IMABox
 
Hierarchy Viewer Internals
Hierarchy Viewer InternalsHierarchy Viewer Internals
Hierarchy Viewer Internals
 
Introduction to android applications stu
Introduction to android applications stuIntroduction to android applications stu
Introduction to android applications stu
 
Html5 RTC - 1
Html5 RTC  - 1Html5 RTC  - 1
Html5 RTC - 1
 
Android OS PPT
Android OS PPTAndroid OS PPT
Android OS PPT
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 
Android introduction&hello world
Android introduction&hello worldAndroid introduction&hello world
Android introduction&hello world
 

Plus de Droidcon Spain

Plus de Droidcon Spain (20)

Concurrency with Promise Style – Rayco Araña
Concurrency with Promise Style – Rayco ArañaConcurrency with Promise Style – Rayco Araña
Concurrency with Promise Style – Rayco Araña
 
Android: más allÁpp – inMedia Studio
Android: más allÁpp – inMedia StudioAndroid: más allÁpp – inMedia Studio
Android: más allÁpp – inMedia Studio
 
Me enamoré de un robot - Tecnilogica
Me enamoré de un robot - TecnilogicaMe enamoré de un robot - Tecnilogica
Me enamoré de un robot - Tecnilogica
 
Apps and cars - Applicantes
Apps and cars - ApplicantesApps and cars - Applicantes
Apps and cars - Applicantes
 
Accesibilidad en apps móviles - Codefactory
Accesibilidad en apps móviles - CodefactoryAccesibilidad en apps móviles - Codefactory
Accesibilidad en apps móviles - Codefactory
 
Visión Artificial, Accesibilidad y Android
Visión Artificial, Accesibilidad y AndroidVisión Artificial, Accesibilidad y Android
Visión Artificial, Accesibilidad y Android
 
Desvelando el GDK - Droidcon Spain
Desvelando el GDK - Droidcon SpainDesvelando el GDK - Droidcon Spain
Desvelando el GDK - Droidcon Spain
 
Monetize your idea! - Pay Pal
Monetize your idea! - Pay PalMonetize your idea! - Pay Pal
Monetize your idea! - Pay Pal
 
Desarrollo ágil de apps con Genexus
Desarrollo ágil de apps con GenexusDesarrollo ágil de apps con Genexus
Desarrollo ágil de apps con Genexus
 
Metodología Scrum para el desarrollo de apps
Metodología Scrum para el desarrollo de appsMetodología Scrum para el desarrollo de apps
Metodología Scrum para el desarrollo de apps
 
Introducción Tu Go and Open Tok - Telefónica i+d
Introducción Tu Go and Open Tok - Telefónica i+d Introducción Tu Go and Open Tok - Telefónica i+d
Introducción Tu Go and Open Tok - Telefónica i+d
 
Tu go - Droidcon
Tu go - DroidconTu go - Droidcon
Tu go - Droidcon
 
Ui testing with espresso
Ui testing with espressoUi testing with espresso
Ui testing with espresso
 
Geolocalización en Android
Geolocalización en Android Geolocalización en Android
Geolocalización en Android
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
 
Programación Reactiva en Android
Programación Reactiva en AndroidProgramación Reactiva en Android
Programación Reactiva en Android
 
Requisitos de Accesibilidad
Requisitos de AccesibilidadRequisitos de Accesibilidad
Requisitos de Accesibilidad
 
Presentación Accesibilidad ASPACENET
Presentación Accesibilidad ASPACENETPresentación Accesibilidad ASPACENET
Presentación Accesibilidad ASPACENET
 
Droid con Aspace-Cross
Droid con Aspace-CrossDroid con Aspace-Cross
Droid con Aspace-Cross
 
Android UI design trends
Android UI design trendsAndroid UI design trends
Android UI design trends
 

Dernier

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Dernier (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 

Open tok Android sdk - Droidcon

  • 1. OpenTok 2.0: Android SDK Marina Serrano Montes marinas@tokbox.com
  • 2. Contents 1. What is OpenTok ? 2. What is WebRTC ? 3. Why using OpenTok ? 4. OpenTokRTC DEMO 5. SDK for Android platform 6. API for Android SDK 7. New features for Android SDK 8. Others APIs
  • 3. 1. What is OpenTok? OpenTok is a OTT platform. It delivers all the global infrastructure, scalability, and features the developers need to add WebRTC to their website or mobile application.
  • 4. 2. What is WebRTC? - A powerful RTC open source standard. It enables real time communication through a common set of APIs. -WebRTC defines a way to implement technologies like video chat in a way that is interoperable with other clients. - It is available for different browsers (plugin is not required) and for native iOS and Android platforms. - WebRTC vs Flash: better video quality faster connections time reduced audio/video latency - Emerging issue: Video Codec debate: VP8 or H.264?
  • 5. 3. Why using OpenTok? Infrastructure, APIs and tools to unlock the potential of WebRTC Fewer lines of code Native SDK for mobiles Experience optimization Archiving & Playback Robust signaling Web SDK Interoperability Global infrastructure Firewall transversal support Intelligent quality controls Multi-party calls High performance
  • 6. 3. Why using OpenTok? Some customer success stories
  • 8. 5. SDK for Android platform Overall architecture
  • 9. 6. API for Android SDK Session Stream Publisher Connection Subscriber OpenTokException
  • 10. 6. API for Android SDK Session Represents an OpenTok session in which the client is participating Tasks: Initializing and connect to a session: public Session (Context context, String sessionId, Listener listener); public void connect(final String apiKey, final String token); public void disconnect(); Getting information about the session: public Connection getConnection();
  • 11. 6. API for Android SDK Publishing audio-video stream to a session: public void publish(Publisher publisher); public void unpublish(Publisher publisher); Subscribing audio-video stream: public void subscribe(Subscriber subscriber); public void unsubscribe(Subscriber subscriber);
  • 12. 6. API for Android SDK Callbacks: public void onSessionConnected(Session session); public void onSessionDisconnected(Session session); public void onSessionReceivedStream(Session session, Stream stream); public void onSessionDroppedStream(Session session, Stream stream); public void onSessionCreatedConnection(Session session, Connection connection); public void onSessionDroppedConnection(Session session, Connection connection); public void onSessionError(Session session, OpentokError error);
  • 13. 6. API for Android SDK Publisher Captures an audio-video stream from the device’s microphone and camera. This stream will be published to an OpenTok session. Tasks: Initializing a publisher: public Publisher (Context context, Listener listener, String name) ; Getting information about the publisher: public boolean getPublishVideo(); public boolean getPublishAudio(); public Session getSession(); public String getStreamId(); public int getCameraId();
  • 14. 6. API for Android SDK Controlling audio and video output for a publisher: public void setPublishVideo(boolean publishVideo); public void setPublishAudio(boolean publishAudio); Setting publisher device configuration: public void setCameraId(int cameraId); public void swapCamera(); Callbacks: public public public public void void void void onPublisherStreamingStarted(); onPublisherStreamingStopped(); onPublisherChangedCamera(int newCameraId); onPublisherException(OpentokException exception);
  • 15. 6. API for Android SDK Subscriber Used to consume an audio-video stream in the OpenTok session. Tasks: Initializing a subscriber: public Subscriber (Context context , Stream stream ) Getting information about the publisher: public boolean getSubscriberToVideo(); public boolean getSubscriberToAudio(); public Session getSession(); public String getStream(); public View getView();
  • 16. 6. API for Android SDK Controlling audio and video playback: public void setSubscribeToAudio(boolean subscribeToAudio); public void setSubscribeToVideo(boolean subscribeToVideo); Callbacks: public void onSubscriberConnected(Subscriber subscriber); public void onSubscriberVideoDisabled(Subscriber subscriber); public void onSubscriberException(Subscriber subscriber, OpentokException exception);
  • 17. 6. API for Android SDK Stream Represents a stream of multimedia, which may contain video and/or audio data. Tasks: Getting basic information about the stream: public String getStreamId(); public Date getCreationTime(); public Connection getConnection(); public String getName(); Getting audio and video information about the stream: public int getVideoWidth(); public boolean hasVideo(); public int getVideoHeight(); public boolean hasAudio();
  • 18. 6. API for Android SDK Connection Represents a connection between a client and an OpenTok session. Tasks: Getting information about the connection: public String getConnectionId(); public Date getCreationTime(); public String getData();
  • 19. 6. API for Android SDK OpenTokException Defines errors thrown by the OpenTok Android SDK. Basic errors categories: Network error -- unable to connect to the session: check the network connection. Authentication error -- unable to connect: an invalid API key or token was provided. Internal error
  • 20. 7. New features for Android SDK For next Android SDK release…. Signaling: Sends a signal to each client or specified clients in the session. public boolean sendSignal(String type, String data); public boolean sendSignal(String type, String data, ArrayList<Connection> connections); Callback: void onSignal(Session session, final String type, final String data, String connectionId, long creationTimeConnection); Eg: mSession.sendSignal("chat", "hello");
  • 21. 7. New features for Android SDK and... Expose video driver & render: Video comes in and out the SDK. - Developers can use the video driver and video render by default in the SDK. or - Developers can implement their own video driver. Some uses cases: * Don't use the camera of the device by default.... * sending a picture as captured video… * adding funny effects to the video….