问题
@Component({
selector: 'invidz-video-js-component',
template: `
<div id="full-background">
<video
id="vid"
class="video-js vjs-default-skin vjs-fullscreen vjs-big-play-centered"
controls
data-setup='{ "techOrder": ["youtube"]}'
>
<source type="video/youtube" [src]="videoUrl"/>
</video>
</div>
`,
`]
})
export class VideoJsComponent implements OnInit, AfterViewInit {
@Input() videoUrl: string;
@Input() autoPlay: string;
private player: any;
constructor() {
}
ngOnInit() {
console.log(this.autoPlay);
console.log(this.videoUrl);
}
ngAfterViewInit() {
this.player = videojs(document.getElementById('vid'));
this.player.on('ended', function() {
});
}
}
Video.js give error "youtube" is undefined while playing youtube video
Error :
video.es.js:439 VIDEOJS: ERROR: The "youtube" tech is undefined. Skipped browser support check for that tech.
来源:https://stackoverflow.com/questions/45355524/video-js-give-error-youtube-is-undefined-while-playing-youtube-video