Questo tratto appartiene a qualsiasi dispositivo che supporta il download di un'anteprima di clip.
Campi
Non sono disponibili campi per questo tratto.
Comandi
Non sono disponibili comandi per questo tratto.
Eventi
ClipPreview
È disponibile un video clip per l'anteprima.
L'anteprima di un clip è un file video di 10 fotogrammi in formato mp4. Puoi scegliere di mostrare il file video mp4 o di transcodificarlo in un altro formato (ad esempio una GIF animata) per mostrare una sequenza completa di 10 fotogrammi. Le funzionalità del client del dispositivo devono essere prese in considerazione quando si seleziona un metodo di anteprima del clip.
Un ID assegnato agli eventi che si verificano nell'ambito di una singola sessione di eventi correlati. Può essere utilizzato per consolidare gli eventi.
string Esempio: "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
previewUrl
L'URL in cui visualizzare l'anteprima del video clip. Il codec video predefinito è
H264.
Un oggetto che indica le risorse che potrebbero avere aggiornamenti simili a questo evento. La risorsa dell'evento stesso (dall'oggetto resourceUpdate) sarà sempre presente in questo oggetto.
object
Per saperne di più sui diversi tipi di eventi e sul loro funzionamento, consulta la sezione Eventi.
Visualizzare l'anteprima del clip
Per visualizzare l'anteprima del clip, effettua una chiamata GET a previewUrl utilizzando il token di accesso OAuth nell'intestazione HTTP Authorization:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCameraClipPreview\u003c/code\u003e trait enables Nest devices to provide a 10-frame video clip preview in mp4 format triggered by motion, person detection, or doorbell chimes.\u003c/p\u003e\n"],["\u003cp\u003eThis trait utilizes the \u003ccode\u003eClipPreview\u003c/code\u003e event, which includes a \u003ccode\u003epreviewUrl\u003c/code\u003e for accessing the clip and an \u003ccode\u003eeventSessionId\u003c/code\u003e for correlating it with other events.\u003c/p\u003e\n"],["\u003cp\u003eTo view the clip preview, make a GET request to the provided \u003ccode\u003epreviewUrl\u003c/code\u003e with your OAuth access token in the Authorization header.\u003c/p\u003e\n"],["\u003cp\u003eThis trait does not have any associated fields or commands, primarily functioning through events to deliver clip previews.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\nCameraClipPreview Schema\n========================\n\n[Nest Doorbell (battery)](/nest/device-access/api/doorbell-battery) [Nest Doorbell (wired)](/nest/device-access/api/doorbell-wired)\n\n`sdm.devices.traits.CameraClipPreview`\n\nThis trait belongs to any device that supports the download of a clip preview.\n\n\u003cbr /\u003e\n\nFields\n------\n\n\nThere are no fields available for this trait.\n\n\u003cbr /\u003e\n\nCommands\n--------\n\nThere are no commands available for this trait.\n\nEvents\n------\n\n\u003cbr /\u003e\n\n### ClipPreview\n\nA video clip is available for preview.\n\nA clip preview is a 10 frame video file in mp4 format. You can choose to show the mp4 video file, or transcode it to another format (for example, an animated gif) in order to show a complete 10 frame sequence. The device client capabilities should be considered when selecting a clip preview method.\n\nThis event is supported for the following events:\n\n| Type | Element | Description |\n|-------|--------------------------------------------------------------------------------------------------|-------------------------------------------|\n| Event | [Motion](/nest/device-access/traits/device/camera-motion#motion) event of the CameraMotion trait | Motion has been detected by the camera. |\n| Event | [Person](/nest/device-access/traits/device/camera-person#person) event of the CameraPerson trait | A person has been detected by the camera. |\n| Event | [Chime](/nest/device-access/traits/device/doorbell-chime#chime) event of the DoorbellChime trait | The doorbell has been pressed. |\n\nUse the `eventSessionId` to associate this event and the related `previewUrl` with one or more supported events.\n\n\u003cbr /\u003e\n\n#### ClipPreview event\n\n### Payload\n\n {\n \"eventId\" : \"7d481e3b-7498-486a-b0b6-fdf4281d5b1f\",\n \"timestamp\" : \"2019-01-01T00:00:01Z\",\n \"resourceUpdate\" : {\n \"name\" : \"enterprises/project-id/devices/device-id\",\n \"events\" : {\n \"sdm.devices.events.CameraClipPreview.ClipPreview\" : {\n \"eventSessionId\" : \"CjY5Y3VKaTZwR3o4Y19YbTVfMF...\",\n \"previewUrl\" : \"https://previewUrl/...\"\n }\n }\n }\n \"userId\" : \"AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi\",\n \"resourceGroup\" : [\n \"enterprises/project-id/devices/device-id\"\n ]\n }\n\n#### ClipPreview event fields\n\n| Field | Description | Data Type |\n|------------------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|\n| `eventSessionId` | An ID given to events occurring as part of a single session of related events. May be used for consolidating events. | `string` Example: \"CjY5Y3VKaTZwR3o4Y19YbTVfMF...\" |\n| `previewUrl` | The URL at which to preview the video clip. The default video codec is H264. | `string` Example: \"https://\u003cvar translate=\"no\"\u003epreviewUrl\u003c/var\u003e/...\" |\n\n#### Event payload fields\n\n| Field | Description | Data Type |\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|\n| `eventId` | The unique identifier for the event. | `string` Example: \"7d481e3b-7498-486a-b0b6-fdf4281d5b1f\" |\n| `timestamp` | The time when the event occurred. | `string` Example: \"2019-01-01T00:00:01Z\" |\n| `resourceUpdate` | An object that details information about the resource update. | `object` |\n| `userId` | A unique, obfuscated identifier that represents the user. | `string` Example: \"AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi\" |\n| `resourceGroup` | An object that indicates resources that might have similar updates to this event. The resource of the event itself (from the `resourceUpdate` object) will always be present in this object. | `object` |\n\nSee [Events](/nest/device-access/api/events) for more information on the different\ntypes of events and how they work.\n\n\u003cbr /\u003e\n\n#### Preview the clip\n\n\u003cbr /\u003e\n\nTo preview the clip, make a GET call to the `previewUrl` using the OAuth access token in the HTTP Authorization header: \n\n### Preview\n\n curl -H 'Authorization: Bearer \u003cvar translate=\"no\"\u003eaccess-token\u003c/var\u003e' \\\n https://\u003cvar translate=\"no\"\u003epreviewUrl\u003c/var\u003e/...\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nErrors\n------\n\nSee the [API Error Code Reference](/nest/device-access/reference/errors/api) for\nthe full list of API error codes.\n\n\u003cbr /\u003e"]]