brandly / angular-youtube-embed

:tv: Embed a YouTube player with a simple directive

Home Page:http://brandly.github.io/angular-youtube-embed/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: `youtube-video` directive won't compile

dwilt opened this issue · comments

I've installed via npm install (and I tried bower first even though I saw your last commit was to try and discourage people from using bower) and I can't get the directive to compile. I can see your script on my page and it's included as a dependency in my app. The <youtube-video video-id="videoId" id="unique-youtube-embed-id-1"></youtube-video> is just sitting in the DOM uncompiled.

No errors are being thrown in the console.

Here's how I'm including it in my project:

import '../node_modules/angular-youtube-embed/dist/angular-youtube-embed.min.js';

angular.module('myApp', [

        // App Plugins
        'ionic',
        'youtube-embed'
    ])

I'd prefer to bower install it and include it as a external script on my page as the I've done with the rest of my front end packages but I'm fine as long as it works.

Thanks for any help!

try something like

import youtubeEmbed from 'angular-youtube-embed'

angular.module('myApp', [
  'ionic',
  youtubeEmbed
])

basically, imports are aware of node_modules, so you shouldn't have to specify a relative path like that. on my end, we declare a main, which points to this file. that file basically loads the directive and exports the necessary dependency string.

let me know if you get this working!

still didn't work, no errors either. Both ways I can see the file is being included on the page so it really shouldn't matter how it's getting in there no? I mean, angular isn't even throwing errors. It sees your module is attached. Let me know if you're interested in a screenshare.

didn't notice your note about bower. it's published there too. (make sure you get that name right 😄)

I did, haha I saw it was a bit different cause of another library. Any more ideas why this wouldn't work?

it's hard to say. there haven't been any new releases with this project, and i've seen this code installed with npm and used. maybe there's a small chance something with npm3 broke this package.

otherwise, it's hard to diagnose. with the number of JS tools out there, it's hard to determine who's at fault here.

could you .zip up some code and share it?

This is a private app that we're working on and I'd prefer to show you the code privately. Could you do a screenshare?

hey Iam also facing same error plz help me Asap

@ashish367 any details on what's happening? is the code for the directive not getting included in your bundle? is it included by not initializing properly?

@dwilt did you get this working?

I can't remember now as I'm on a different project but if I remember correctly we were unable to get this to work

@dwilt sorry to hear that!!

@ashish367 are you including the YouTube iframe API as shown here? as of v1.3.1, you should see a message in your console if the YouTube library is not included.

Hi,
I found this error some video are not embed due to video restriction by
owner so iam trying to add origin:"www.youtube.com
http://www.youtube.com" but i failed *
*Error on Console:

www-widgetapi.js:27 Failed to execute 'postMessage' on 'DOMWindow': The
target origin provided ('https://www.youtube.com
https://www.youtube.com') does not match the recipient window's origin

Iam trying to embed this video on my cordova project on my webview
"https://www.youtube.com/embed/eI6T19qPx2Q?enablejsapi=1
https://www.youtube.com/embed/eI6T19qPx2Q?enablejsapi=1"

Regards,
Ashish Yadav
CM Software Services Pvt. Ltd.
Email: ashish.yadav@cmss.in
Mobile: +91 9702099924
Website: www.cmss.in

On Sun, Jul 31, 2016 at 9:51 PM, Matthew Brandly notifications@github.com
wrote:

@dwilt https://github.com/dwilt sorry to hear that!!

@ashish367 https://github.com/ashish367 are you including the YouTube
iframe API as shown here
https://github.com/brandly/angular-youtube-embed#can-i-use-it? as of
v1.3.1, you should see a message in your console if the YouTube library
is not included.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#100 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATrwqhmDbcXxYiUkAELf8eItNGA6neM2ks5qbMumgaJpZM4HUnQf
.

forgot to mention Thanks and please have any suggestion how to embed
restriction video also plz

Regards,
Ashish Yadav
CM Software Services Pvt. Ltd.
Email: ashish.yadav@cmss.in
Mobile: +91 9702099924
Website: www.cmss.in

On Mon, Aug 1, 2016 at 12:23 PM, Ashish Yadav ashish.yadav@cmss.in wrote:

Hi,
I found this error some video are not embed due to video restriction by
owner so iam trying to add origin:"www.youtube.com
http://www.youtube.com" but i failed *
*Error on Console:

www-widgetapi.js:27 Failed to execute 'postMessage' on 'DOMWindow': The
target origin provided ('https://www.youtube.com
https://www.youtube.com') does not match the recipient window's origin

Iam trying to embed this video on my cordova project on my webview "https://www.youtube.com/embed/eI6T19qPx2Q?enablejsapi=1
https://www.youtube.com/embed/eI6T19qPx2Q?enablejsapi=1"

Regards,
Ashish Yadav
CM Software Services Pvt. Ltd.
Email: ashish.yadav@cmss.in
Mobile: +91 9702099924
Website: www.cmss.in

On Sun, Jul 31, 2016 at 9:51 PM, Matthew Brandly <notifications@github.com

wrote:

@dwilt https://github.com/dwilt sorry to hear that!!

@ashish367 https://github.com/ashish367 are you including the YouTube
iframe API as shown here
https://github.com/brandly/angular-youtube-embed#can-i-use-it? as of
v1.3.1, you should see a message in your console if the YouTube library
is not included.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#100 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATrwqhmDbcXxYiUkAELf8eItNGA6neM2ks5qbMumgaJpZM4HUnQf
.