SamirHodzic / ngx-embed-video

Get embed code for embedding youtube/vimeo/dailymotion/* video in websites from URL or ID in Angular 6+.
MIT License
56 stars 41 forks source link

How to handle error in the Youtube URL #24

Closed saicharanbollampally closed 5 years ago

saicharanbollampally commented 5 years ago

this.embedService.embed(this.exercise.YoutubeUrl, { query: { portrait: 0, color: 'black' }, attr: { width: 800, height: 380, frameborder:1 } }).then(res => { this.iframeURL = res.html; });

Error: this.embedService.embed(...).then is not a function

SamirHodzic commented 5 years ago

You mixed embed and embed_image usage. embed function doesn't have callback.

this.iframeURL = this.embedService.embed(this.exercise.YoutubeUrl, {
    query: { portrait: 0, color: 'black' },
    attr: { width: 800, height: 380, frameborder:1 }
});