Smart Home CameraStream Trait Schema
action.devices.traits.CameraStream
- This trait covers how to control the camerastream of a device.
This trait belongs to devices which have the capability to stream video feeds to third party screens, Chromecast-connected screens, or smartphones. By and large, these are security cameras or baby cameras. But this trait also applies to more complex devices which have a camera on them (for example, video-conferencing devices or a vacuum robot with a camera on it).
Device ATTRIBUTES
Devices with this trait may report the following
attributes as part of the SYNC
operation. To learn
more about handling SYNC
intents, see
Intent fulfillment.
Attributes | Type | Description |
---|---|---|
cameraStreamSupportedProtocols |
Array |
Required. Supported media types, according to preference, for the real-time stream. |
[item, ...] |
String |
Media type. Supported values:
|
cameraStreamNeedAuthToken |
Boolean |
Required. Whether an auth token will be provided via |
cameraStreamNeedDrmEncryption |
Boolean |
Deprecated (Default: Whether the stream content requires DRM encryption. |
Examples
Camera with multiple protocols support, not requiring an auth token.
{ "cameraStreamSupportedProtocols": [ "hls", "dash", "smooth_stream", "progressive_mp4" ], "cameraStreamNeedAuthToken": false }
Camera supporting a single protocol, requiring an auth token.
{ "cameraStreamSupportedProtocols": [ "hls" ], "cameraStreamNeedAuthToken": true }
Device STATES
None.
Device COMMANDS
Devices with this trait may respond to the following
commands as part of the EXECUTE
operation. To learn
more about handling EXECUTE
intents, see
Intent fulfillment.
action.devices.commands.GetCameraStream
Begin streaming the camera (the return URL of the stream) which Google presents on a screen, such as the user's phone, the Assistant surface itself, or through another media or Cast target.
Parameters
Parameters | Type | Description |
---|---|---|
StreamToChromecast |
Boolean |
Required. Whether the stream will be played on a Chromecast device. Currently, this is always true. |
SupportedStreamProtocols |
Array |
Required. Media types/formats supported by the desired destination. |
[item, ...] |
String |
Media type. Supported values:
|
Examples
Show the front door.
{ "command": "action.devices.commands.GetCameraStream", "params": { "StreamToChromecast": true, "SupportedStreamProtocols": [ "progressive_mp4", "hls", "dash", "smooth_stream" ] } }
Show front door camera on my Chromecast.
{ "command": "action.devices.commands.GetCameraStream", "params": { "StreamToChromecast": true, "SupportedStreamProtocols": [ "hls" ] } }
Results
Results | Type | Description |
---|---|---|
cameraStreamAccessUrl |
String |
Required. URL endpoint for retrieving the real-time stream in the format specified by |
cameraStreamReceiverAppId |
String |
Cast receiver ID to process the camera stream; default receiver will be used if not provided. |
cameraStreamAuthToken |
String |
An auth token for the specific receiver to authorize access to the stream. If |
cameraStreamProtocol |
String |
Required. The media format that the stream url points to. It should be one of the protocol listed in the Supported values:
|
Examples
Show the front door (default Cast receiver).
{ "cameraStreamAccessUrl": "https://fluffysheep.com/baaaaa.mp4", "cameraStreamProtocol": "progressive_mp4" }
Show front door camera (custom Cast receiver).
{ "cameraStreamAccessUrl": "https://fluffysheep.com/baaaaa.mp4", "cameraStreamReceiverAppId": "1g2f89213hg", "cameraStreamAuthToken": "12657342190192783", "cameraStreamProtocol": "progressive_mp4" }
Device ERRORS
See the full list of errors and exceptions.Supported streaming protocols
This trait supports the following streaming protocols:
hls
: HTTP Live Streamingdash
: Dynamic Adaptive Streaming over HTTPsmooth_stream
: Smooth Streamingprogressive_mp4
: Progressive MP4 (mostly used for clips)