Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular-youtube-player
Advanced tools
An Angular component module for using the embedded YouTube iframe player.
An Angular component module for using the embedded YouTube (iframe) player.
npm install angular-youtube-player
In the module (e.g. AppModule
) where it will be used:
/* ... */
import { YTPlayerModule } from 'angular-youtube-player';
@NgModule({
/* ... */
imports: [
YTPlayerModule,
BrowserModule
]
})
export class AppModule { }
There are two options are currently configurable:
// config
imports: [
YTPlayerModule,
BrowserModule
],
providers: [{ provide: YTPlayerConfig, useValue: { shouldLoadAPI: true, multiplePlaying: false } }],
You could use either the constructor:
import { YTPlayerConfig } from 'angular-youtube-player';
const useValue = new YTPlayerConfig(shouldLoadAPI, multiplePlaying);
or an object literal:
const useValue = { shouldLoadAPI: true, multiplePlaying: false };
to build the config, both values are optional.
shouldLoadAPI = true
By default using this module would load the YouTube iframe player API, if you prefer to load it on your own, you could set it to false. Note that it would still require the API to be loaded.
multiplePlaying = false
When there are multiple instances of the player, it would only allow one to be playing by default (i.e. playing one would pause the other playing ones). You could set this to true if you want to allow multiple videos playing at the same time.
Here's a list of the component's input and output properties:
@Input() videoId: string;
@Input() domId: string;
@Input() parameters: string|YT.PlayerVars;
@Output() ready = new EventEmitter();
@Output() unstarted = new EventEmitter();
@Output() ended = new EventEmitter();
@Output() playing = new EventEmitter();
@Output() paused = new EventEmitter();
@Output() buffering = new EventEmitter();
@Output() cued = new EventEmitter();
videoId
The YouTube video id to play
domId
(optional)The DOM element id of the player
parameters
(optional)The player options, could be a query string or a object
Reference on IFrame Player Parameters
The output events are all from the IFrame Player API.
public
properties and methodspublic get currentTime(): number
public play(): void
public pause(): void
public cueVideoById(videoId: string, startSeconds?: number): void
public loadVideoById(videoId: string, startSeconds?: number): void
FAQs
An Angular component module for using the embedded YouTube iframe player.
The npm package angular-youtube-player receives a total of 47 weekly downloads. As such, angular-youtube-player popularity was classified as not popular.
We found that angular-youtube-player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.