Skip to content

Commit 1437d35

Browse files
committed
Add shortcode support for ASL.
1 parent d61178e commit 1437d35

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ableplayer.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ function ableplayer_shortcode( $atts, $content = null ) {
401401
'vimeo-desc-id' => '',
402402
'media-id' => '',
403403
'media-desc-id' => '',
404+
'media-asl-id' => '',
404405
'captions' => '',
405406
'subtitles' => '',
406407
'descriptions' => '',
@@ -448,6 +449,14 @@ function ableplayer_shortcode( $atts, $content = null ) {
448449
$source = '<source data-desc-src type="' . esc_attr( $type ) . '" src="' . esc_url( $media_desc_id ) . '">';
449450
}
450451
}
452+
if ( $all_atts['media-asl-id'] ) {
453+
// If Video ID is set but is not a valid URL, return.
454+
$media_desc_id = ( is_numeric( $all_atts['media-asl-id'] ) ) ? wp_get_attachment_url( $all_atts['media-asl-id'] ) : $all_atts['media-desc-id'];
455+
if ( $media_desc_id ) {
456+
$type = get_post_mime_type( $media_desc_id );
457+
$source = '<source data-sign-src type="' . esc_attr( $type ) . '" src="' . esc_url( $media_desc_id ) . '">';
458+
}
459+
}
451460

452461
$tracks = array();
453462
$kinds = array(

0 commit comments

Comments
 (0)