Pergunta

Now as WordPress natively supports videos in posts using MediaPlayer.js, I wonder how I can make use of that within my theme files?

Foi útil?

Solução

To use Wordpress native player Mediaelement.js inside your theme you can implement any of the methods below:

  1. If using HTML5, simply add the video using <video> tag, rest all Wordpress will take care of it.
  2. Use do_shortcode('[video src="video-source.mp4"]')
  3. Use wp_video_shortcode( $attr ) where $attr is the attribute of the video shortcode.

Also you should have the correct version of Wordpress that support Mediaelement.js as their native player (as old versions don't)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top