RequireJS and Plyr
See original GitHub issueIf I use RequireJS and Plyr, I didn’t receive the Plyr instance:
Example: (Lock at the console output)
https://s.codepen.io/jonnitto/debug/zWeGjz/LQkExPzbXpYA
<script src='https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.js'></script>
<script >
require(["https://cdn.plyr.io/3.1.0/plyr.js"], function () {
console.log('3.1.0', arguments);
});
require(["https://cdn.plyr.io/2.0.18/plyr.js"], function () {
console.log('2.0.18', arguments);
});
</script>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
plyr.js Not working with RequireJS, Can you please tell me ...
js in the path for "plyr", is because require.js supports a mode where paths can be 'chained' together (ie: part of a path...
Read more >RequireJS API
The data-main attribute is a special attribute that require.js will check to start script loading. This example will end up with a baseUrl...
Read more >RequireJS and Brightcove Player
In this topic, you will learn how to use RequireJS, a JavaScript file and module loader, with Brightcove Player. RequireJS assists in ...
Read more >Plyr 3 - requirejs - CodePen
URL Extension Required. When linking another Pen as a resource, make sure you use a URL Extension of the type of code you...
Read more >Solved: Issue with requireJS and plyr.js - Magento Forums
Solved: Hello, I'am trying during few days to add plyr.js ( https://github.com/sampotts/plyr ) in magento 2.2.6. in order to change default ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the same solution. Released Plyr 3 for Neos.io: https://github.com/jonnitto/Jonnitto.Plyr and https://github.com/jonnitto/Jonnitto.TextWithPlyr
I’m also not that well acquainted with requirejs. I tried searching for “requirejs external named modules” for example, but with no luck. This strikes me as a pretty basic use case, but still nothing. If requirejs still has a decent number of users out there, you could probably find help on stackoverflow and similar places.
This should work too:
Feels like a hack rather than a solution though.