PHPackages                             samo/youtubeiframe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. samo/youtubeiframe

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

samo/youtubeiframe
==================

get a youtube video embedded iframe easly from url or video id

v1.0.1(5y ago)742MITPHP

Since Aug 14Pushed 5y ago3 watchersCompare

[ Source](https://github.com/abdussalam-alali/Laravel-Youtube-iframe-generator)[ Packagist](https://packagist.org/packages/samo/youtubeiframe)[ RSS](/packages/samo-youtubeiframe/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (3)Used By (0)

Samo/YoutubeIframe
==================

[](#samoyoutubeiframe)

get youtube players iframes from URL or Video ID easily
-------------------------------------------------------

[](#get-youtube-players-iframes-from-url-or-video-id-easily)

install
=======

[](#install)

`composer require samo/youtubeiframe`

Usage
=====

[](#usage)

In controller
-------------

[](#in-controller)

```
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;
}
```

### Result:

[](#result)

[![image of mr bing](https://camo.githubusercontent.com/2b1b01a749c2c2c4dc84bdf9a07e999cec7c3c2df6a5e3166104247aa84e3f78/68747470733a2f2f692e6962622e636f2f76566b4e6a4a682f312e6a7067)](https://camo.githubusercontent.com/2b1b01a749c2c2c4dc84bdf9a07e999cec7c3c2df6a5e3166104247aa84e3f78/68747470733a2f2f692e6962622e636f2f76566b4e6a4a682f312e6a7067)

In view
-------

[](#in-view)

```

{!! Samo\YoutubeIframe\Iframe::css('border-radius:50px;')
            ->width(100,'%')
            ->height(400,'px')
            ->noFullScreen()
            ->get('https://www.youtube.com/watch?v=35JzR2ymxJE')!!}

```

Available methods:
==================

[](#available-methods)

css($str)
---------

[](#cssstr)

Defines additional CSS properities sperated by ';'
Example :
`Iframe::css('border:1px solid #000;opacity:0.7')->get('35JzR2ymxJE');`

height($val=300,$unit='px')
---------------------------

[](#heightval300unitpx)

Sets the player height (Default is 300px)
Example :
`Iframe::height(500,'px')->get('35JzR2ymxJE');`

width($val=500,$unit='px')
--------------------------

[](#widthval500unitpx)

Sets the player width (default is 500px)
Example :
`Iframe::width(500,'px')->get('35JzR2ymxJE');`

get($urlOrID)
-------------

[](#geturlorid)

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

noFullScreen()
--------------

[](#nofullscreen)

disable full screen feature

addAttribute($att)
------------------

[](#addattributeatt)

adds a HTML attributes
Example :
`Iframe::addAttribute('class="pt-5"')->addAttribute('id="pl1")->get('35JzR2ymxJE');`

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2139d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/997714?v=4)[Abdussalam](/maintainers/Abdussalam)[@abdussalam](https://github.com/abdussalam)

---

Top Contributors

[![abdussalam-alali](https://avatars.githubusercontent.com/u/61018710?v=4)](https://github.com/abdussalam-alali "abdussalam-alali (13 commits)")

### Embed Badge

![Health badge](/badges/samo-youtubeiframe/health.svg)

```
[![Health](https://phpackages.com/badges/samo-youtubeiframe/health.svg)](https://phpackages.com/packages/samo-youtubeiframe)
```

###  Alternatives

[msp/devtools-m1

MageSpecialist DevTools for Magento 1

2640.6k](/packages/msp-devtools-m1)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
