Skip to content

Commit 30e5784

Browse files
committed
DOC-3223: Add missing uploadcare_resources option, cleanup of unsupported video_props.
1 parent a655b43 commit 30e5784

File tree

4 files changed

+90
-22
lines changed

4 files changed

+90
-22
lines changed

modules/ROOT/pages/uploadcare-video.adoc

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ tinymce.init({
4747
[NOTE]
4848
====
4949
The {pluginname} plugin uses the same plugin code `+uploadcare+` as the Media Optimizer plugin. Video functionality is automatically enabled when video files are uploaded.
50+
51+
When bundling {productname} with webpack or similar tools, the xref:uploadcare.adoc#uploadcare-resources[uploadcare_resources] option is required for video functionality to work properly, as it tells the plugin where to find the additional JavaScript resources needed for video playback.
5052
====
5153

5254
== Video Operations
@@ -68,48 +70,38 @@ Below is an overview of the features provided by the Video Optimizer plugin:
6870

6971
Below are the video player control options that are available to the video element:
7072

71-
[cols="1,1,4",options="header"]
73+
[cols="2,4",options="header"]
7274
|===
73-
| Operation | Icon | Description
75+
| Operation | Description
7476

7577
| Play
76-
|
7778
| Customize video player controls and behavior
7879

7980
| Mute
80-
|
8181
| Mute the video
8282

8383
| Unmute
84-
|
8584
| Unmute the video
8685

8786
| Slider
88-
|
8987
| Shows the progress of the video and allows users to move the slider to seek to a specific time in the video
9088

9189
| Resize
92-
| image:icons/resize.svg[resize.svg]
9390
| Changes the size of the video (when enabled)
9491

9592
| Remaining Time
96-
|
9793
| Shows the remaining time of the video
9894

9995
| Picture-in-Picture
100-
|
10196
| Enables picture-in-picture mode for the video
10297

10398
| Settings
104-
|
10599
| Opens the video settings menu
106100

107101
| Fullscreen
108-
|
109102
| Enables fullscreen mode for the video
110103

111104
| UC Logo
112-
|
113105
| Shows the Uploadcare logo
114106
|===
115107

@@ -137,14 +129,11 @@ The plugin creates a custom `+<uc-video>+` element that replaces the standard HT
137129
autoplay="false"
138130
loop="false"
139131
muted="false"
140-
playsinline="true"
141132
preload="metadata"
142133
width="640"
143134
height="360"
144135
poster="https://example.com/poster.jpg"
145-
crossorigin="anonymous"
146136
showlogo="false"
147-
posteroffset="5s">
148137
</uc-video>
149138
----
150139

modules/ROOT/pages/uploadcare.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ tinymce.init({
4141
plugins: 'uploadcare',
4242
toolbar: 'uploadcare uploadcare-video',
4343
uploadcare_public_key: '<your-public-key>', // Required for Uploadcare integration
44+
uploadcare_resources: 'uploadcare/uploadcare', // Required when Media Optimizer addon is bundled with TinyMCE
4445
// uploadcare_signed_upload_auth_provider: (_publicKey) => Promise.resolve({
4546
// signature: 'sig',
4647
// expire: 123
@@ -83,6 +84,8 @@ include::partial$configuration/uploadcare_cdn_base_url.adoc[leveloffset=+1]
8384

8485
include::partial$configuration/uploadcare_store_type.adoc[leveloffset=+1]
8586

87+
include::partial$configuration/uploadcare_resources.adoc[leveloffset=+1]
88+
8689
:includedSection: uploadcarePlugin
8790
include::partial$configuration/a11y_advanced_options.adoc[leveloffset=+1]
8891
:!includedSection:
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[[uploadcare-resources]]
2+
== `uploadcare_resources`
3+
4+
Specifies the base path where the Uploadcare plugin resources are served from. This option is primarily used when bundling {productname} with webpack or other bundlers, where the plugin needs to know where to load additional resources such as the `ucvideo.min.js` file for video functionality.
5+
6+
When {productname} is bundled, the Uploadcare plugin cannot automatically determine where its additional resources are located. This option tells the plugin where to find these resources by specifying the root path to the Uploadcare plugin directory.
7+
8+
*Type:* `+String+`
9+
10+
*Default:* `+undefined+`
11+
12+
*Possible values:* A string that points to the root path of the Uploadcare plugin directory.
13+
14+
[NOTE]
15+
This option is only required when using the **Media Optimizer** as a paid "addon" and bundling {productname} with webpack or similar bundling tools.
16+
17+
.Example: Setting `uploadcare_resources`
18+
[source,js]
19+
----
20+
tinymce.init({
21+
selector: 'textarea',
22+
plugins: 'uploadcare',
23+
toolbar: 'uploadcare uploadcare-video',
24+
uploadcare_public_key: '<your-public-key>',
25+
uploadcare_resources: 'uploadcare/uploadcare', // Points to the uploadcare plugin directory
26+
license_key: '<your-license-key>'
27+
});
28+
----
29+
30+
=== Complete Bundled Setup Example
31+
32+
For a complete example of setting up {productname} with the Uploadcare addon, see the bundled setup example:
33+
34+
[source,html]
35+
----
36+
<!DOCTYPE html>
37+
<html lang="en">
38+
<head>
39+
<meta charset="UTF-8">
40+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
41+
<title>TinyMCE with Uploadcare Addon</title>
42+
<script src="path/to/tinymce/tinymce.min.js"></script> <!-- points to the tinymce.min.js file in your project -->
43+
<script src="path/to/uploadcare/uploadcare/plugin.min.js"></script> <!-- points to the uploadcare plugin.min.js file in your project -->
44+
</head>
45+
<body>
46+
<textarea>Welcome to TinyMCE with Uploadcare!</textarea>
47+
<script>
48+
tinymce.init({
49+
selector: 'textarea',
50+
plugins: [
51+
"uploadcare"
52+
],
53+
toolbar: "uploadcare uploadcare-video",
54+
uploadcare_resources: 'path/to/uploadcare/uploadcare', // points to the uploadcare plugin directory
55+
uploadcare_public_key: '<your-public-key>',
56+
license_key: '<your-license-key>'
57+
});
58+
</script>
59+
</body>
60+
</html>
61+
----
62+
63+
=== Resource Structure
64+
65+
When using `uploadcare_resources`, ensure your directory structure follows this pattern:
66+
67+
.Example directory structure:
68+
[source,text]
69+
----
70+
project/
71+
├── uploadcare/
72+
│ └── uploadcare/
73+
│ ├── js/
74+
│ │ └── ucvideo.min.js
75+
│ ├── css/
76+
│ │ └── uc-video.css
77+
│ └── plugin.min.js
78+
└── tinymce/
79+
└── tinymce.min.js
80+
----
81+
82+
The plugin will automatically append the necessary subpaths (e.g., `/js/ucvideo.min.js`) to the base path you specify.

modules/ROOT/partials/configuration/uploadcare_video_properties.adoc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,18 @@ Configures the video player properties and behavior for video elements.
99

1010
=== Properties
1111

12-
[cols="2,1,2,1,2"]
12+
[cols="1,1,2,1,2"]
1313
|===
1414
|Property | Type | Valid Values | Default | Description
1515
|`autoplay` | Boolean | `true`, `false`, `undefined` | `undefined` | Automatically starts video playback when the page loads.
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.
17-
|`controlsList` | String | `nodownload`, `nofullscreen`, `noremoteplayback` (space-separated) | `undefined` | Specifies which controls to hide from the video player interface. Use space-separated values to disable multiple controls (e.g., `"nodownload nofullscreen"`).
18-
|`disablePictureInPicture` | Boolean | `true`, `false`, `undefined` | `undefined` | Prevents the video from entering picture-in-picture mode, which allows users to continue watching while using other applications or tabs.
19-
|`disableRemotePlayback` | Boolean | `true`, `false`, `undefined` | `undefined` | Disables the ability to cast or stream the video to external devices like Chromecast or AirPlay.
2017
|`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"`.
2118
|`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.
2219
|`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.
23-
|`playsInline` | Boolean | `true`, `false`, `undefined` | `undefined` | Forces the video to play inline within the page instead of opening in fullscreen mode on mobile devices. Essential for preventing unwanted fullscreen behavior on iOS Safari. Without this attribute, iOS devices will automatically enter fullscreen mode when video playback begins, which can disrupt the user experience in web applications or when videos are part of a larger content layout.
2420
|`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.
2521
|`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.
2622
|`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"`.
27-
|`crossOrigin` | String | `anonymous`, `use-credentials` | `undefined` | Configures CORS (Cross-Origin Resource Sharing) for the video element. Use `anonymous` for basic cross-origin requests or `use-credentials` when cookies/credentials are needed.
2823
|`showLogo` | Boolean | `true`, `false` | `true` | Displays the Uploadcare logo overlay on the video player.
29-
|`posterOffset` | String | Time string (e.g., `5s`) | `undefined` | Sets a specific time offset (in seconds) for the poster image generation.
3024
|===
3125

3226

0 commit comments

Comments
 (0)