Skip to content

Commit 43ae4e2

Browse files
committed
deploy: 8b5204d
1 parent 671a557 commit 43ae4e2

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

ableplayer.php.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@
361361
),
362362
'youtube-id' => array(
363363
'default' => '',
364-
'description' => __( '11-character YouTube ID or a URL to a YouTube video page.', 'ableplayer' ),
364+
'description' => __( 'YouTube ID or a URL to a YouTube video page.', 'ableplayer' ),
365365
),
366366
'youtube-desc-id' => array(
367367
'default' => '',
368-
'description' => __( '11-character YouTube ID of an alternative described version of a video.', 'ableplayer' ),
368+
'description' => __( 'YouTube ID or URL of an alternative described version of a video.', 'ableplayer' ),
369369
),
370370
'youtube-nocookie' => array(
371371
'default' => '',
@@ -426,6 +426,8 @@
426426
'vimeo-id' => '',
427427
'vimeo-desc-id' => '',
428428
'media-id' => '',
429+
'media-desc-id' => '',
430+
'media-asl-id' => '',
429431
'captions' => '',
430432
'subtitles' => '',
431433
'descriptions' => '',
@@ -465,6 +467,22 @@
465467
$source = '<source type="' . esc_attr( $type ) . '" src="' . esc_url( $media_id ) . '">';
466468
}
467469
}
470+
if ( $all_atts['media-desc-id'] ) {
471+
// If Video ID is set but is not a valid URL, return.
472+
$media_desc_id = ( is_numeric( $all_atts['media-desc-id'] ) ) ? wp_get_attachment_url( $all_atts['media-desc-id'] ) : $all_atts['media-desc-id'];
473+
if ( $media_desc_id ) {
474+
$type = get_post_mime_type( $media_desc_id );
475+
$source = '<source data-desc-src type="' . esc_attr( $type ) . '" src="' . esc_url( $media_desc_id ) . '">';
476+
}
477+
}
478+
if ( $all_atts['media-asl-id'] ) {
479+
// If Video ID is set but is not a valid URL, return.
480+
$media_desc_id = ( is_numeric( $all_atts['media-asl-id'] ) ) ? wp_get_attachment_url( $all_atts['media-asl-id'] ) : $all_atts['media-desc-id'];
481+
if ( $media_desc_id ) {
482+
$type = get_post_mime_type( $media_desc_id );
483+
$source = '<source data-sign-src type="' . esc_attr( $type ) . '" src="' . esc_url( $media_desc_id ) . '">';
484+
}
485+
}
468486

469487
$tracks = array();
470488
$kinds = array(

0 commit comments

Comments
 (0)