문제

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

도움이 되었습니까?

해결책

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top