Closed jonnitto closed 6 years ago
That's because that way doesn't work with named modules I think.
<script src='https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.js'></script>
<script src="https://cdn.plyr.io/3.1.0/plyr.js"></script>
<script>
require(["Plyr"], function () {
console.log('3.1.0', arguments);
});
</script>
I'm not massively familiar with require but sounds like you have your solution? If so, can you please close this one.
I still have to figure it out. I‘ve to support our old UI in the Neos Plugin. I think the post @friday made will help, but I can‘t use the code 1:1. I‘ll close this issue as soon as I have a solution.
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:
require(["https://cdn.plyr.io/3.1.0/plyr.js"], function () {
require(["Plyr"], function () {
console.log('3.1.0', arguments);
});
});
Feels like a hack rather than a solution though.
I found the same solution. Released Plyr 3 for Neos.io: https://github.com/jonnitto/Jonnitto.Plyr and https://github.com/jonnitto/Jonnitto.TextWithPlyr
If 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