Analizaremos brevemente el crecimiento del acceso móvil a Internet y la relevancia que Android tiene actualmente para los servicios que lanza Telefónica, para dar paso después a una charla técnica sobre dos de nuestros desarrollos. TU Go convierte tu número de teléfono en una aplicación, permitiéndote realizar y recibir llamadas desde donde mejor te convenga en cada momento; analizaremos detalles de la implementación en Android. OpenTok es una plataforma que facilita la integración de WebRTC en tu sitio web y tus aplicaciones móviles; entraremos en más detalle con la implementación para Android.
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….