BambuserBroadcaster, BambuserPlayer  1.0.1
Instance Methods | List of all members
<BambuserViewDelegate> Protocol Reference

#import <BambuserViewDelegate.h>

Instance Methods

(void) - bambuserError:message:
(void) - chatMessageReceived:
(void) - broadcastStarted
(void) - captureInterrupted:
(void) - captureInterruptionEnded
(void) - broadcastStopped
(void) - broadcastDisconnected
(void) - broadcastResumed
(void) - recordingComplete:
(void) - healthUpdated:
(void) - currentViewerCountUpdated:
(void) - totalViewerCountUpdated:
(void) - talkbackRequest:caller:talkbackID:
(void) - talkbackStateChanged:
(void) - broadcastIdReceived:
(void) - snapshotTaken:
(void) - uplinkTestComplete:recommendation:

Detailed Description

Protocol for a delegate to handle updates and exceptions when using BambuserView.

The delegate of a BambuserView must adopt the BambuserViewDelegate protocol. Optional methods of the protocol allow the delegate to receive signals about the state of broadcasts.

Method Documentation

- (void) bambuserError: (enum BambuserError errorCode
message: (NSString *)  errorMessage 

This method will be called to relay any error to the delegate.

errorCodeDefined in BambuserConstants.h
errorMessageUser readable error message, where available
- (void) broadcastDisconnected

This method will be called when the broadcasting process has been disconnected from the remote server, but while still trying to reconnect.

- (void) broadcastIdReceived: (NSString *)  broadcastId

This method is called when the server has returned the unique id given to the broadcast.

- (void) broadcastResumed

This method will be called after broadcastDisconnected, if the BambuserView managed to reconnect and resume broadcasting.

- (void) broadcastStarted

This method will be called when the BambuserView has successfully connected to a Bambuser video server and a broadcast has been started.

- (void) broadcastStopped

This method will be called when the BambuserView has been disconnected from a Bambuser video server and broadcasting has stopped.

- (void) captureInterrupted: (AVCaptureSessionInterruptionReason)  reason

This method will be called when the video capture has been interrupted by an external event. This could e.g. be an incoming phone call, Siri or audio playback from an application allowing background audio. While interrupted the BambuserView has no access to camera nor microphone.

This callback can be used to show a dialog informing that video capture has been interrupted.

reasonReason for interrupt.
- (void) captureInterruptionEnded

This method will be called when the video capture is running again after an interruption.

BambuserView will try to continue an interrupted broadcast, if the connection to the Bambuser backend is still available, when an interruption ends. Note! If BambuserView:saveLocally is set to YES a broadcast will always be stopped at an interrupt.

- (void) chatMessageReceived: (NSString *)  message

This method is called every time a chat message is received from the server.

messageContains the message
- (void) currentViewerCountUpdated: (int)  viewers

Called when the number of current viewers is updated.

viewersNumber of current viewers of the broadcast. This is generally the most interesting number during a live broadcast.
- (void) healthUpdated: (int)  health

During an ongoing broadcast, this method is called whenever the BambuserView's health property is updated.

healthContains the stream health value in percents
- (void) recordingComplete: (NSString *)  filename

This method will be called when broadcasting has been stopped and a local copy has been saved.

By default the file is located in the sandbox's NSTemporaryDirectory() and may be removed by the system when your application is not running. It is your responsibility to copy, move, remove or export this file to camera roll.

filenameContains the filename of the recorded file
See also
- (void) snapshotTaken: (UIImage *)  image

When calling the takeSnapshot method, this method will return the result if successful. The actual dimensions of the snapshot are limited by the active camera resolution, and can vary depending on device. If cropping has been requested using the setOrientation:previewOrientation:withAspect:by: (BambuserView) method, the snapshot will be cropped to the desired aspect ratio.

- (void) talkbackRequest: (NSString *)  request
caller: (NSString *)  caller
talkbackID: (int)  talkbackID 

This method is called when an incoming talkback request is received.

The strings caller and request are set by the caller. The integer talkbackID is unique for this broadcast and request, and is used when accepting a talkback request.

requestA free form string set by the caller
callerA string containing the callers name
talkbackIDA unique number associated with this talkback request
- (void) talkbackStateChanged: (enum TalkbackState state

This method is called when talkback status changes.

stateDefined in BambuserConstants.h
- (void) totalViewerCountUpdated: (int)  viewers

Called when the total number of viewers is updated.

viewersTotal number of viewers of the broadcast. This accumulates over time. The counted viewers are not guaranteed to be unique, but there are measures in place to exclude obvious duplicates, eg. replays from a viewer.
- (void) uplinkTestComplete: (float)  speed
recommendation: (BOOL)  shouldBroadcast 

This method is called when an uplink test has been completed. Uplink speed will be tested automatically when applicationId has been set and a valid broadcast ticket has been retrieved. The supplied speed is bytes per second, -1 if test fails or can't be done. shouldBroadcast is YES if attempting to broadcast is advisable. BambuserView will allow broadcasting regardless of the speed test results. The speed test results are only offered as guidance.