Change default Video Player without Plugin
Change default Video Player without Plugin
Change default Video Player without Plugin
we can’t tell much from this screenshot apart that you’ve indeed installed video.js (at least part of it). this is a big guess but i would say that the lib tries to get your media element by id, but the id being wrong it doesn’t have access to a play method, most i can do … Read more
you can achieve that in many ways, PHP, plain Javascript, Jquery…depending on many other variables in your theme / app. I could list pros and cons for all methods , but it is not the right place .. In php for example, you could use browser detection both directly on user agent OR with get_browser() … Read more
It looks like the Video Embed & Thumbnail Generator already does what you are looking for.
Try adding another attribute See the Codex
An alternative would be to use WordPress’s build in auto embed, the following line in core is responsible for auto embed: add_filter( ‘the_content’, array(&$this, ‘autoembed’), 8 ); Which means: Whenever we are about to display content try to auto embed all url’s with a priority of 8. You could add a custom filter before this … Read more
If a shortcode isn’t too much effort you can use it to construct the soundcloud url for embedding. add_shortcode(‘soundcloud_auto’, ‘soundcloud_auto_shortcode’); function soundcloud_auto_shortcode($atts) { global $post; $title = str_replace(” “, “”, $post->post_title); $title = str_replace(“-“, “”, $title); $title = str_replace(“_”, “”, $title); $slug = sanitize_title($title, str_replace(“-“, “”, $post->post_name)); return wp_oembed_get(esc_url(“http://soundcloud.com/$slug”)); } Or do something similar using … Read more
Not sure about how much control you want to offer to your viewers but you can always use the <video> tag in HTML to display a player. You can read more about this here – https://www.w3schools.com/html/html5_video.asp If you are looking to provide the option of adjusting the quality and all you might have to host … Read more
This seems to work for now.. Added onended=”onEndVideo()” to the video element like so. <?php $mrssfeed_url = get_post_meta(get_the_id(), ‘nowthisearth_media_url’, true);?> <video onended=”onEndVideo()” id=”nowthis-video” class=”nowthis-video” style=”” width=”1280″ height=”720″ autoplay=”true” controls> <source src=”<?php echo $mrssfeed_url ?>” type=”video/mp4″> Your browser does not support the video tag. </video> Then did this for the javascript.. function onEndVideo() { document.querySelector(“a.next-post”).click(); }
The Codex lists several core-supported oEmbed sites (including a few being added in 3.5): YouTube (only public videos and playlists – “unlisted” and “private” videos will not embed) Vimeo (note older versions of WP have issues with https embeds, just remove the s from the https to fix) DailyMotion blip.tv Flickr (both videos and images) … Read more