📋 IRemoteVideo behavior#
The IRemoteVideo behavior provides fields for storing external video information on any Dexterity content type.
It is registered as sc.videos.remotevideo and applied by default to the 📄 Video content type.
Module: sc.videos.behaviors.video
Interface: sc.videos.behaviors.video.IRemoteVideo
🏷️ Fields#
Field |
Type |
Required |
Default |
Widget |
Description |
|---|---|---|---|---|---|
|
|
Yes |
. |
|
External video URL (YouTube, Vimeo). Validated against registered providers. |
|
|
No |
. |
. |
Video duration in seconds. Populated automatically from metadata. |
|
|
No |
. |
. |
Video hosting service. Values from the |
|
|
No |
|
. |
Channel or author name of the video. |
|
|
No |
|
. |
Provider-specific video identifier (for example, YouTube's 11-character ID). |
|
|
No |
|
|
Raw metadata JSON returned by the provider. Used internally to populate other fields. |
📂 Field organization#
The behavior organizes its fields into two fieldsets:
Default: contains
videoUrl(ordered before all other fields viadirectives.order_before).Video Metadata: contains
duration,service,channel,video_id, and_metadata. These fields are populated automatically by the metadata fetching pipeline and are typically not edited by hand.
🔗 The VideoURL field#
VideoURL is a custom field type (sc.videos.fields.url.VideoURL) that extends zope.schema.URI with provider validation:
Validates that the value is a well-formed URI.
Calls
resolve_url()to check the URL against all registered 🔌 The provider system patterns.Raises
InvalidVideoURLif the URL doesn't match any known provider.
On the frontend, it renders as the VideoURLWidget. see 🔧 Volto widgets.
⚡ Event-driven metadata population#
When a Video content item is created or modified, event subscribers automatically populate the behavior fields from the _metadata JSON:
sc.videos.subscribers.video.added. fires onIObjectAddedEvent.sc.videos.subscribers.video.modified. fires onIObjectModifiedEvent.
Both call _update_video_metadata(), which:
Reads
_metadatafrom the content object.Copies
duration,channel,video_id, andserviceinto their respective fields (only if changed).Downloads the thumbnail from
thumbnail_urland sets it aspreview_image(only if the content doesn't already have one).
🧩 Using the behavior on other content types#
The behavior can be applied to any Dexterity content type. Add it via GenericSetup XML or in your type's Python schema:
<!-- types/MyVideo.xml -->
<property name="behaviors" purge="false">
<element value="sc.videos.remotevideo" />
</property>
The behavior provides the video fields, but you will also need the frontend
add-on installed for the VideoURLWidget and metadata fetching to work in the
Volto editor.
See also
📄 Video content type. The default Video content type that uses this behavior.
🔄 The video metadata pipeline. How metadata flows from URL to content fields.
🌐 REST API. @video-metadata. The
@video-metadataendpoint that powers the metadata fetching.