Skip to content

Instantly share code, notes, and snippets.

@luixaviles
Created February 6, 2020 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luixaviles/ae266e5856254be46d4d572be5ded18c to your computer and use it in GitHub Desktop.
Save luixaviles/ae266e5856254be46d4d572be5ded18c to your computer and use it in GitHub Desktop.
import {NgModule} from '@angular/core';
import {YouTubePlayerModule} from '@angular/youtube-player';
@NgModule({
imports: [
YouTubePlayerModule,
],
declarations: [YoutubePlayerExample],
})
export class YoutubePlayerExampleModule {
}
@Component({
template: '<youtube-player videoId="PRQCAL_RMVo" />',
selector: 'youtube-player-example',
})
class YoutubePlayerExample implements OnInit {
ngOnInit() {
const tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
document.body.appendChild(tag);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment