angular-youtube-embed icon indicating copy to clipboard operation
angular-youtube-embed copied to clipboard

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

Open dwilt opened this issue 9 years ago • 12 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!

dwilt avatar Feb 05 '16 20:02 dwilt

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!

brandly avatar Feb 05 '16 21:02 brandly

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.

dwilt avatar Feb 05 '16 21:02 dwilt

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

brandly avatar Feb 05 '16 21:02 brandly

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

dwilt avatar Feb 05 '16 21:02 dwilt

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?

brandly avatar Feb 07 '16 21:02 brandly

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?

dwilt avatar Feb 08 '16 20:02 dwilt

hey Iam also facing same error plz help me Asap

ashish367 avatar Jul 27 '16 05:07 ashish367

@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?

brandly avatar Jul 30 '16 17:07 brandly

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 avatar Jul 31 '16 00:07 dwilt

@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.

brandly avatar Jul 31 '16 16:07 brandly

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: [email protected] Mobile: +91 9702099924 Website: www.cmss.in

On Sun, Jul 31, 2016 at 9:51 PM, Matthew Brandly [email protected] 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 https://github.com/brandly/angular-youtube-embed/issues/100#issuecomment-236439419, or mute the thread https://github.com/notifications/unsubscribe-auth/ATrwqhmDbcXxYiUkAELf8eItNGA6neM2ks5qbMumgaJpZM4HUnQf .

ashish367 avatar Aug 01 '16 06:08 ashish367

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: [email protected] Mobile: +91 9702099924 Website: www.cmss.in

On Mon, Aug 1, 2016 at 12:23 PM, Ashish Yadav [email protected] 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: [email protected] Mobile: +91 9702099924 Website: www.cmss.in

On Sun, Jul 31, 2016 at 9:51 PM, Matthew Brandly <[email protected]

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 https://github.com/brandly/angular-youtube-embed/issues/100#issuecomment-236439419, or mute the thread https://github.com/notifications/unsubscribe-auth/ATrwqhmDbcXxYiUkAELf8eItNGA6neM2ks5qbMumgaJpZM4HUnQf .

ashish367 avatar Aug 03 '16 06:08 ashish367