question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RequireJS and Plyr

See original GitHub issue

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

<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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jonnittocommented, Apr 11, 2018

I found the same solution. Released Plyr 3 for Neos.io: https://github.com/jonnitto/Jonnitto.Plyr and https://github.com/jonnitto/Jonnitto.TextWithPlyr

1reaction
fridaycommented, Apr 10, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found