startVideoStreaming()
Starts streaming video with audio using the specified settings, including video and audio format.
int startVideoStreaming(
VideoStreamingFormat videoStreamingFormat ,
AudioStreamingFormat audioStreamingFormat,
StreamingBufferCallback videoBufferCallback,
StreamingBufferCallback audioBufferCallback,
StreamingEventCallback streamingEventCallback
)
Parameters
videoStreamingFormat
This specifies the video format used for video streaming.
audioStreamingFormat
This specifies the audio format used for video streaming.
videoBufferCallback
This is the callback that receives the video data.
audioBufferCallback
This is the callback that receives the audio data.
streamingEventCallback
This is the callback that receives the streaming event.
Return value
0 if function calling is successful; otherwise, -1 .
Exception
The following exceptions may be thrown: UnregisteredAppException, GlassesPermissionDeniedException.
Struct
public struct VideoStreamingFormat {
int bitrate,
VideoQuality videoQuality,
FrameRate frameRate,
boolean highEfficiency
}
Parameters
bitrate
This determines the amount of data processed per unit of time, affecting the overall video quality and file size.
frameRate
This specifies the frame rate (FPS) for video streaming.
videoQuality
This specifies the resolution of the video taken using the VIVE AI Glasses camera.
highEfficency
Reserved for future used. This specifies whether a high-efficiency video encoder should be used or not.
Struct
public class AudioStreamingFormat {
public final Microphone microphone;
public final int bitrate;
public final int sampleRate;
public final AudioChannel channelCount;
}
Parameters
microphone
This specifies the directional pickup pattern of the microphone.
bitrate
This determines the amount of data processed per unit of time, affecting the overall audio quality and file size.
sampleRate
This specifies the number of audio samples captured per second.
channelCount
This specifies the number of audio channels.
Permissions
Camera and microphone permissions are required before calling startVideoStreaming().
See also
Video streaming
int startVideoStreaming (VideoQuality quality, StreamingBufferCallback videoBufferCallback, StreamingBufferCallback audioBufferCallback, StreamingEventCallback streamingEventCallback)
Starts streaming video with audio using the specified basic settings.
int startVideoStreaming (VideoQuality quality, AudioStreamingFormat audioStreamingFormat, StreamingBufferCallback videoBufferCallback, StreamingBufferCallback audioBufferCallback, StreamingEventCallback streamingEventCallback)
Starts streaming video with audio using the specified settings, including audio format.
void stopVideoStreaming ()
Stops the video session and releases all associated resources.
boolean isVideoStreaming ()
Checks if there is an ongoing video session.
Responding from VIVE AI Glasses event
interface StreamingEventCallback
This protocol defines the methods for handling the asynchronous streaming event received from VIVE AI Glasses.
interface StreamingBufferCallback
This protocol defines the methods for handling asynchronous streaming data transmissions received from VIVE AI Glasses.
Permissions
void requestPermission()
Requests permission to access VIVE AI Glasses resources.
PermissionResult checkPermission()
Checks if the app has been granted the required permissions.
Enumerations
enum VideoQuality
This defines the resolution and bit rate for videos taken using the VIVE AI Glasses camera.
enum StreamingEvent
This defines the lifecycle state of a media stream.
enum Permission
This defines the permission that the app is requesting.
enum PermissionResult
This indicates the result of the permission request.
enum Framerate
This defines the framerate for videos taken using the VIVE AI Glasses camera.
Error handling and exceptions
This represents an error thrown by the VIVE AI Glasses SDK.