0

I am trying to dynamically load a video in the media library using the built in MediaElement player. To do this, I am using the do_shortcode() function to run the [video] shortcode and build up the necessary divs and such.

However, no matter what I do, the do_shortcode() with [video] only returns a href link and not the video player. Any suggestions?

<?php echo do_shortcode("[video src= 'link_to_my_video.mp4 ']"); ?>
0

Wordpress has this little minimally documented function, wp_video_shortcode()

Just pass an array with the necessary information as if you were writing out the shortcode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.