Ce trait appartient à tout appareil permettant de télécharger un aperçu d'extrait.
Champs
Aucun champ n'est disponible pour ce trait.
Commandes
Aucune commande n'est disponible pour ce trait.
Événements
ClipPreview
Un extrait vidéo est disponible en aperçu.
Un aperçu de clip est un fichier vidéo de 10 images au format MP4. Vous pouvez choisir d'afficher le fichier vidéo mp4 ou de le transcoder dans un autre format (par exemple, un GIF animé) afin d'afficher une séquence complète de 10 images. Les capacités du client de l'appareil doivent être prises en compte lors de la sélection d'une méthode d'aperçu de l'extrait.
Cet événement est compatible avec les événements suivants :
ID attribué aux événements qui se produisent au cours d'une même session d'événements associés. Peut être utilisé pour regrouper des événements.
string Exemple : "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
previewUrl
URL permettant de prévisualiser l'extrait vidéo. Le codec vidéo par défaut est H264.
string Exemple : "https://previewUrl/..."
Champs de charge utile des événements
Champ
Description
Type de données
eventId
Identifiant unique de l'événement.
string Exemple : "7ea2c967-7649-443e-9bb9-083b809764a4"
timestamp
Heure à laquelle l'événement s'est produit.
string Exemple : "2019-01-01T00:00:01Z"
resourceUpdate
Objet contenant des informations détaillées sur la mise à jour de la ressource.
object
userId
Identifiant unique et obscurci représentant l'utilisateur.
string Exemple : "AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi"
resourceGroup
Objet qui indique les ressources susceptibles d'avoir des mises à jour similaires à cet événement. La ressource de l'événement lui-même (à partir de l'objet resourceUpdate) sera toujours présente dans cet objet.
object
Pour en savoir plus sur les différents types d'événements et leur fonctionnement, consultez Événements.
Prévisualiser l'extrait
Pour prévisualiser l'extrait, effectuez un appel GET à previewUrl en utilisant le jeton d'accès OAuth dans l'en-tête d'autorisation HTTP :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/06 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/06 (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"]]