Skip to content

Commit ad70a2d

Browse files
committed
merge develop
2 parents dbcf3cd + 072039c commit ad70a2d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/media/class-video.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Video {
5252
*
5353
* @var string
5454
*/
55-
const PLAYER_VER = '1.3.3';
55+
const PLAYER_VER = '1.4.0';
5656

5757
/**
5858
* Cloudinary Core Version.
5959
*
6060
* @var string
6161
*/
62-
const CORE_VER = '2.6.2';
62+
const CORE_VER = '2.6.3';
6363

6464
/**
6565
* Meta key to store usable video transformations for an attachment.
@@ -220,6 +220,7 @@ public function filter_video_shortcode( $html, $attr ) {
220220

221221
if ( isset( $attr['autoplay'] ) ) {
222222
$args['autoplay'] = 'true' === $attr['autoplay'];
223+
$args['muted'] = 'true' === $attr['autoplay'];
223224
}
224225
if ( isset( $attr['loop'] ) ) {
225226
$args['loop'] = 'true' === $attr['loop'];
@@ -285,6 +286,7 @@ public function filter_video_tags( $content ) {
285286
// Enable Autoplay for this video.
286287
if ( false !== strpos( $tag, 'autoplay' ) ) {
287288
$args['autoplayMode'] = $this->config['video_autoplay_mode']; // if on, use defined mode.
289+
$args['muted'] = 'always' === $this->config['video_autoplay_mode'];
288290
}
289291
// Enable Loop.
290292
if ( false !== strpos( $tag, 'loop' ) ) {
@@ -348,7 +350,6 @@ public function print_video_scripts() {
348350
$default = array(
349351
'publicId' => $cloudinary_id,
350352
'sourceTypes' => array( $video['format'] ), // @todo Make this based on eager items as mentioned above.
351-
'controls' => 'on' === $this->config['video_controls'] ? true : false,
352353
'autoplay' => 'off' !== $this->config['video_autoplay_mode'] ? true : false,
353354
'loop' => 'on' === $this->config['video_loop'] ? true : false,
354355
);
@@ -363,9 +364,9 @@ public function print_video_scripts() {
363364
if ( empty( $config['size'] ) && ! empty( $config['transformation'] ) && ! $this->media->get_crop_from_transformation( $config['transformation'] ) ) {
364365
$config['fluid'] = true;
365366
}
366-
367+
368+
$config['controls'] = 'on' === $this->config['video_controls'] ? true : false;
367369
$cld_videos[ $instance ] = $config;
368-
369370
}
370371

371372
if ( empty( $cld_videos ) ) {

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/ui-definitions/tabs/settings-global-video-transformations.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
'condition' => array(
6161
'video_player' => 'cld',
6262
),
63+
'description' => sprintf(
64+
// translators: Placeholders are <a> tags.
65+
__( 'Please note that when choosing "always", the video will autoplay without sound (muted). This is a built-in browser feature and applies to all major browsers.%1$sRead more about muted autoplay%2$s', 'cloudinary' ),
66+
'<br><a href="https://developers.google.com/web/updates/2016/07/autoplay" target="_blank">',
67+
'</a>',
68+
),
6369
),
6470

6571
'video_loop' => array(

0 commit comments

Comments
 (0)