Video.js give error “youtube” is undefined while playing youtube video

南楼画角 提交于 2020-01-05 04:08:08

问题


 @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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!