Support » Plugin: MediaElement.js - HTML5 Video & Audio Player » [Plugin: MediaElement.js – HTML5 Video & Audio Player] Video failing to load using shortcode and

  • I’m trying to use this plugin to embed a video that is attached to a custom post type.

    This is the code that isn’t working:

    <?php echo $video_link; ?>
    <?php echo do_shortcode('[video src=" ' . $video_link . ' "]'); ?> // spaces between quotes to help differentiate them

    The $video_link is being defined from the post meta in previous code and the first echo command is returning the proper URL to the .mp4 file. The second line isn’t properly loading the video in the player. When I view the HTML source of the page, the player is showing src=”” so I figure either I have a syntax issue with my php, or the plugin isn’t properly reading the shortcode. Thoughts?

    (And, for what it’s worth, if I replace the ‘ . $video_link . ‘ in that second line with a direct URL to one of the videos, it loads just fine.)

    http://wordpress.org/extend/plugins/media-element-html5-video-and-audio-player/

Viewing 1 replies (of 1 total)
  • not sure if anyone is looking for a solution but this was mine (for audio files):

    <?php echo do_shortcode('[audio src="' . get_post_meta($post->ID, 'audiourl', $single = true) . '"] ' ); ?>

    hope this helps someone! 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: MediaElement.js – HTML5 Video & Audio Player] Video failing to load using shortcode and’ is closed to new replies.