<?php
/**
 * Video internal view
 *
 * @package wp-video-attention
 * @author InstaProduct
 * @link http://insta-product.com/
 */

 function ipvisc_videoWidgetShortcodeClass( $class ) { return 'ipvisc-video-widget-upload-player'; }
 add_filter( 'wp_video_shortcode_class', 'ipvisc_videoWidgetShortcodeClass' );

$videoPost    = $this->videoPost;
$videoSetting = $this->setting;
$style        = $this->style;
$setting      = $this->styleSetting;
$videoId      = $videoSetting->getSetting( 'video_file' );
$poster       = 0;

if ( $imageId = $videoSetting->getSetting( 'video_poster' ) ){
  $data   = wp_get_attachment_image_src( $imageId, 'full' );
  $poster = $data[0];
}

$videoAtts = wp_prepare_attachment_for_js( $videoId );
$videoPath = get_attached_file( $videoId );

$width   = $setting->getSetting( 'width', 320 );
$padding = $setting->getSetting( 'padding', 0 );
$vheight = $setting->getSetting( 'video_height', 260 );
$vwidth  = $width - ($padding*2);

$scAtts = array(
  'src'       => $videoAtts['url'],
  'poster'    => $poster,
  'height'    => $vheight,
  'width'     => $vwidth
);

echo wp_video_shortcode( $scAtts );

function ipvisc_videoShortcodeClassReset( $class ) { return 'wp-video-shortcode'; }
add_filter( 'wp_video_shortcode_class', 'ipvisc_videoShortcodeClassReset' );
?>
