Skip to content

Commit 0806a44

Browse files
committed
DOC-3224: uc-video tags can now be made responsive.
1 parent a5fa683 commit 0806a44

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

modules/ROOT/pages/8.3.0-release-notes.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ include::partial$misc/admon-releasenotes-for-stable.adoc[]
2828

2929
The following premium plugin updates were released alongside {productname} {release-version}.
3030

31+
=== Media Optimizer
32+
33+
The {productname} {release-version} release includes an accompanying release of the **Media Optimizer** premium plugin.
34+
35+
**Media Optimizer** includes the following improvements.
36+
37+
==== `uc-video` tags can now be made responsive
38+
39+
The **Media Optimizer** plugin's video functionality has been enhanced with a new configuration option for the xref:uploadcare-video.adoc#uploadcare-video-properties[`uploadcare_video_properties`] setting:
40+
41+
* **`fluid`**: Enables responsive video sizing. When set to `true`, videos are automatically sized responsively using `width: min(original-width, 100%)` CSS, allowing them to scale down on smaller screens while maintaining their maximum size.
42+
43+
For information on the **Media Optimizer** plugin, see: xref:uploadcare-video.adoc[Media Optimizer: Video].
44+
3145
// === <Premium plugin name 1> <Premium plugin name 1 version>
3246

3347
// The {productname} {release-version} release includes an accompanying release of the **<Premium plugin name 1>** premium plugin.

modules/ROOT/pages/uploadcare-video.adoc

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,38 @@ include::partial$configuration/uploadcare_video_resize.adoc[leveloffset=+1]
117117

118118
The plugin creates a custom `+<uc-video>+` element that replaces the standard HTML `+<video>+` element when videos are processed through Uploadcare's infrastructure.
119119

120-
.Example: Custom video element created by the plugin on video insertion
120+
.Example: Custom video element created by the plugin on video insertion (responsive)
121121
[source,html]
122122
----
123123
<uc-video
124124
uuid="video-uuid-here"
125125
class="tox-uc-video"
126-
contenteditable="false"
127-
data-setup="{}"
126+
contenteditable="true"
127+
fluid="true"
128128
controls="true"
129129
autoplay="false"
130130
loop="false"
131131
muted="false"
132132
preload="metadata"
133-
width="640"
134-
height="360"
133+
style="width: min(640px, 100%);"
134+
poster="https://example.com/poster.jpg"
135+
showlogo="false"
136+
</uc-video>
137+
----
138+
139+
.Example: Custom video element with fixed dimensions (non-responsive)
140+
[source,html]
141+
----
142+
<uc-video
143+
uuid="video-uuid-here"
144+
class="tox-uc-video"
145+
contenteditable="true"
146+
controls="true"
147+
autoplay="false"
148+
loop="false"
149+
muted="false"
150+
preload="metadata"
151+
style="width: 640px; height: 360px;"
135152
poster="https://example.com/poster.jpg"
136153
showlogo="false"
137154
</uc-video>

modules/ROOT/partials/configuration/uploadcare_video_properties.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Configures the video player properties and behavior for video elements.
1515
|`autoplay` | Boolean | `true`, `false`, `undefined` | `undefined` | Automatically starts video playback when the page loads. NOTE: Even if autoplay is enabled, modern browsers may delay or block playback until the user interacts with the page, depending on their autoplay policies.
1616
|`controls` | Boolean | `true`, `false` | `true` | Displays the video player controls (play/pause, volume, timeline, fullscreen, etc.). When disabled, users can still control playback through keyboard shortcuts or programmatic methods.
1717
|`disablePictureInPicture` | Boolean | `true`, `false`, `undefined` | `undefined` | Disables the Picture-in-Picture feature for the video player. When enabled, users cannot use Picture-in-Picture mode.
18-
|`height` | Number or String | Pixels or CSS value | `undefined` | Sets the video player height. Accepts numeric values (interpreted as pixels) or CSS values like `"100%"`, `"50vh"`, or `"auto"`.
18+
|`fluid` | Boolean | `true`, `false`, `undefined` | `undefined` | Enables responsive video sizing. When set to `true`, videos are automatically sized responsively using `width: min(original-width, 100%)` CSS, allowing them to scale down on smaller screens while maintaining their maximum size.
19+
|`height` | Number or String | Pixels or CSS value | `undefined` | Sets the video player height. Accepts numeric values (interpreted as pixels) or CSS values like `"100%"`, `"50vh"`, or `"auto"`. When a numeric value is provided, it is applied as an inline CSS style with `px` units (e.g., `height: 360px`).
1920
|`loop` | Boolean | `true`, `false`, `undefined` | `undefined` | Automatically restarts video playback from the beginning when it reaches the end. Useful for background videos or continuous content loops.
2021
|`muted` | Boolean | `true`, `false`, `undefined` | `undefined` | Mutes the video audio by default. Often used in combination with autoplay since most browsers require muted videos for autoplay to function.
2122
|`poster` | String | Valid URL | `undefined` | Sets a poster image (thumbnail) that displays before video playback begins. The image should match the video's aspect ratio for best results.
2223
|`posterOffset` | String | Time format `"MM:SS"` or `"H:MM:SS"` | `undefined` | Sets the time offset for generating a poster image from the video. When `poster` is not specified, this value determines the frame to use as the poster. Format: `"0:10"` for 10 seconds, `"1:30"` for 1 minute 30 seconds.
2324
|`preload` | String | `auto`, `metadata`, `none` | `undefined` | Controls how much video data to preload: `auto` loads the entire video, `metadata` loads only basic information, `none` loads nothing until playback starts. Performance considerations: use `metadata` for better page load times and bandwidth conservation, `auto` for immediate playback without buffering delays, and `none` for maximum bandwidth savings when videos may not be played.
2425
|`showLogo` | Boolean | `true`, `false` | `false` | Displays the Uploadcare logo overlay on the video player.
25-
|`width` | Number or String | Pixels or CSS value | `undefined` | Sets the video player width. Accepts numeric values (interpreted as pixels) or CSS values like `"100%"`, `"50vw"`, or `"auto"`.
26+
|`width` | Number or String | Pixels or CSS value | `undefined` | Sets the video player width. Accepts numeric values (interpreted as pixels) or CSS values like `"100%"`, `"50vw"`, or `"auto"`. When a numeric value is provided, it is applied as an inline CSS style with `px` units (e.g., `width: 640px`). When used with `fluid: true`, the width is applied responsively using `width: min(original-width, 100%)`.
2627
|===
2728

28-
2929
.Example: Basic video player configuration
3030

3131
[source,js]
@@ -45,6 +45,7 @@ tinymce.init({
4545
posterOffset: '0:10', // Time offset for poster generation
4646
width: 640,
4747
height: 360,
48+
fluid: true, // Enables responsive video sizing
4849
showLogo: false
4950
},
5051
});

0 commit comments

Comments
 (0)