Video Post Fullscreen and Volume

How do I add a volume control and a fullscreen button on a video post?

Hi there,

Thanks for writing in.

Is it an embed code? You can’t change the visual of a player when it’s hosted somewhere else. If it’s cornerstone’s video element or classic video player element, then you can toggle on the Advance feature, it will then display the fullscreen and audio buttons. If it’s a shortcode, then simply add advanced_controls="true" to your shortcode.

Thanks!

I added the video on a video post. It shows up where the featured image would. See the screenshot above. Where do I select the advance feature?

Hi there,

Ah, it’s not a shortcode or element. Please add this code to your child theme’s functions.php to override the existing featured video.

  function x_featured_video( $post_type = 'video' ) {

    $entry_id     = get_the_ID();
    $stack        = x_get_stack();
    $aspect_ratio = get_post_meta( $entry_id, '_x_' . $post_type . '_aspect_ratio', true );
    $m4v          = get_post_meta( $entry_id, '_x_' . $post_type . '_m4v', true );
    $ogv          = get_post_meta( $entry_id, '_x_' . $post_type . '_ogv', true );
    $embed        = get_post_meta( $entry_id, '_x_' . $post_type . '_embed', true );
    $fullwidth    = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;

    if ( $fullwidth ) {
      $poster = wp_get_attachment_image_src( get_post_thumbnail_id( $entry_id ), 'entry-fullwidth', false );
    } else {
      $poster = wp_get_attachment_image_src( get_post_thumbnail_id( $entry_id ), 'entry', false );
    }

    if ( $embed != '' ) {
      echo do_shortcode( '[x_video_embed type="' . $aspect_ratio . '" no_container="true" class="mvn"]' . stripslashes( htmlspecialchars_decode( $embed ) ) . '[/x_video_embed]' );
    } else {
      echo do_shortcode( '[x_video_player advanced_controls="true" m4v="' . $m4v . '" ogv="' . $ogv . '" poster="' . $poster[0] . '" type="' . $aspect_ratio . '" preload="metadata" hide_controls="false" autoplay="false" loop="false" muted="false" no_container="true" class="mvn"]' );
    }

  }

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.