File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,7 @@ function ableplayer_shortcode( $atts, $content = null ) {
400400 'vimeo-id ' => '' ,
401401 'vimeo-desc-id ' => '' ,
402402 'media-id ' => '' ,
403+ 'media-desc-id ' => '' ,
403404 'captions ' => '' ,
404405 'subtitles ' => '' ,
405406 'descriptions ' => '' ,
@@ -439,6 +440,14 @@ function ableplayer_shortcode( $atts, $content = null ) {
439440 $ source = '<source type=" ' . esc_attr ( $ type ) . '" src=" ' . esc_url ( $ media_id ) . '"> ' ;
440441 }
441442 }
443+ if ( $ all_atts ['media-desc-id ' ] ) {
444+ // If Video ID is set but is not a valid URL, return.
445+ $ media_desc_id = ( is_numeric ( $ all_atts ['media-desc-id ' ] ) ) ? wp_get_attachment_url ( $ all_atts ['media-desc-id ' ] ) : $ all_atts ['media-desc-id ' ];
446+ if ( $ media_desc_id ) {
447+ $ type = get_post_mime_type ( $ media_desc_id );
448+ $ source = '<source data-desc-src type=" ' . esc_attr ( $ type ) . '" src=" ' . esc_url ( $ media_desc_id ) . '"> ' ;
449+ }
450+ }
442451
443452 $ tracks = array ();
444453 $ kinds = array (
You can’t perform that action at this time.
0 commit comments