Fix preview video when no public video is available

parent a90896e8
...@@ -114,7 +114,7 @@ if(!class_exists('SH_VideoGallery')) { ...@@ -114,7 +114,7 @@ if(!class_exists('SH_VideoGallery')) {
$hls_public = $video->hls_public; $hls_public = $video->hls_public;
$hls_member = $video->hls_members; $hls_member = $video->hls_members;
$hls_premium = $video->hls_premium; $hls_premium = $video->hls_premium;
$video_preview = $video->video_preview; $video_preview = $video->preview;
$gif_preview = $video->gif_small; $gif_preview = $video->gif_small;
sexhack_log($video); sexhack_log($video);
...@@ -137,8 +137,8 @@ if(!class_exists('SH_VideoGallery')) { ...@@ -137,8 +137,8 @@ if(!class_exists('SH_VideoGallery')) {
$vtags=array(); $vtags=array();
$downtag =''; $downtag ='';
if((!$hls_public) AND (!$hls_member) AND (!$hls_premium) AND ($video_preview) ) $vtags[] = '<label class="sexhack_vtag sexhack_preview" style="*LEFT*">preview</label>';
if($hls_public) $vtags[] = '<label class="sexhack_vtag sexhack_public" style="*LEFT*">public</label>'; if($hls_public) $vtags[] = '<label class="sexhack_vtag sexhack_public" style="*LEFT*">public</label>';
elseif($video_preview) $vtags[] = '<label class="sexhack_vtag sexhack_preview" style="*LEFT*">preview</label>';
if($hls_member)$vtags[] = '<label class="sexhack_vtag sexhack_members" style="*LEFT*">members</label>'; if($hls_member)$vtags[] = '<label class="sexhack_vtag sexhack_members" style="*LEFT*">members</label>';
if($hls_premium)$vtags[] = '<label class="sexhack_vtag sexhack_premium" style="*LEFT*">premium</label>'; if($hls_premium)$vtags[] = '<label class="sexhack_vtag sexhack_premium" style="*LEFT*">premium</label>';
......
...@@ -84,7 +84,7 @@ get_header(); ?> ...@@ -84,7 +84,7 @@ get_header(); ?>
$hls_public = $video->hls_public; $hls_public = $video->hls_public;
$hls_members = $video->hls_members; $hls_members = $video->hls_members;
$hls_premium = $video->hls_premium; $hls_premium = $video->hls_premium;
$video_preview = $video->video_preview; $video_preview = $video->preview;
$gif_preview = $video->gif_small; $gif_preview = $video->gif_small;
$gif = $video->gif; $gif = $video->gif;
...@@ -183,6 +183,12 @@ get_header(); ?> ...@@ -183,6 +183,12 @@ get_header(); ?>
default: // public too! default: // public too!
if($hls_public && $video->video_type=='VR') echo do_shortcode( "[sexvideo url=\"".$hls_public."\" posters=\"".$thumb."\"]" ); if($hls_public && $video->video_type=='VR') echo do_shortcode( "[sexvideo url=\"".$hls_public."\" posters=\"".$thumb."\"]" );
else if($hls_public) echo do_shortcode( "[sexhls url=\"".$hls_public."\" posters=\"".$thumb."\"]" ); else if($hls_public) echo do_shortcode( "[sexhls url=\"".$hls_public."\" posters=\"".$thumb."\"]" );
else if($video_preview) {
//echo do_shortcode( "[sexvideo url=\"".$video_preview."\" posters=\"".$thumb."\"]" );
// XXX BUG: sexvideo doesn't like google.drive.com/uc? videos for cross-site problems?
echo '<video src='."'$video_preview'".' controls autoplay muted playsinline loop></video></div></div>';
header("Access-Control-Allow-Origin: *");
}
else if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>'; else if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>'; else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment