SlideShare a Scribd company logo
1 of 23
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked (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
 

Similar to Open tok Android sdk - Droidcon

Similar to 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
 

More from Droidcon Spain

More from 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
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.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….