Advertisement
phpface

Fix Fullscreen on iOS

May 26th, 2023
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. /**
  2.  *
  3.  * Fix Fullscreen on iOS
  4.  *
  5.  */
  6. add_filter( 'streamtube/player/file/setup', function( $setup, $source ){
  7.  
  8.     if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false
  9.         || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false) {
  10.  
  11.         if( $setup['sources'][0]['type'] == 'video/youtube' ){
  12.             $setup = array_merge( $setup, array(
  13.                 'youtube'       =>  array(
  14.                     'ytControls'    =>  2
  15.                 ),
  16.                 'controlBar'            =>  false          
  17.             ) );
  18.         }
  19.     }
  20.  
  21.     return $setup;
  22. }, 9999, 2 );
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement