composer require samo/youtubeiframe
use Samo\YoutubeIframe\Iframe;
public function index()
{
$iframe = Iframe::css('border-radius:50px;')
->width(100,'%')
->height(400,'px')
->noFullScreen()
->get('https://www.youtube.com/watch?v=35JzR2ymxJE');
return $iframe;
}
<div class="video_container">
{!! Samo\YoutubeIframe\Iframe::css('border-radius:50px;')
->width(100,'%')
->height(400,'px')
->noFullScreen()
->get('https://www.youtube.com/watch?v=35JzR2ymxJE')!!}
</div>
Defines additional CSS properities sperated by ';'
Example :
Iframe::css('border:1px solid #000;opacity:0.7')->get('35JzR2ymxJE');
Sets the player height (Default is 300px)
Example :
Iframe::height(500,'px')->get('35JzR2ymxJE');
Sets the player width (default is 500px)
Example :
Iframe::width(500,'px')->get('35JzR2ymxJE');
Returns the Iframe markup you can pass URL or Video ID
Accepted url format :
youtube.com/watch?v=xxxxxx
youtu.be.com/xxxxxxx
youtube.com/?v=xxxxxx
disable full screen feature
adds a HTML attributes
Example :
Iframe::addAttribute('class="pt-5"')->addAttribute('id="pl1")->get('35JzR2ymxJE');