Skip to content

YouTube API with async! plugin #36

@mhrisse

Description

@mhrisse

Hi!

I have a little trouble loading the YouTube Iframe API using the !async plugin, any help appreciated! (Hope it's ok to highight this here).

The maps example works, so I am currently assuming the basic setup must be ok:

define('something', [
'async!http://maps.google.com/maps/api/js?sensor=false'
], function () { console.log('loaded..'); } 
);

// doesn't work
define('something', [
'async!https://www.youtube.com/iframe_api!callback'
], function () { console.log('loaded..'); } 
);

// doesn't work
define('something', [
'async!https://www.youtube.com/iframe_api!onYouTubeIframeAPIready'
], function () { console.log('loaded..'); } 
);

// doesn't work
define('something', [
'async!https://www.youtube.com/iframe_api'
], function () { console.log('loaded..'); } 
);

They all get me the Uncaught Error: Load timeout for modules: async!https://www.youtube.com/iframe_api!onload_unnormalized2,async!https://www.youtube.com/iframe_api!onload
http://requirejs.org/docs/errors.html#timeout or similar (depeding on setting after the second !)

which probably means the callback function is never called. If I defined the callback function myself it works.. but still getting the timeout error.

window.onYouTubeIframeAPIready = function () {
console.log('youtube api usual callback');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions