2.3.1 • Published 9 months ago
openplayerjs-youtube v2.3.1
OpenPlayer.js - YouTube
Now you can play any YouTube videos using the awesome OpenPlayerJS!
Installation
- Set the video/audio as indicated in the OpenPlayerJS installation.
- Set the
type
of your source asvideo/x-youtube
. - Load this package library right after OpenPlayerJS.
- And voilá!
Configuration
It allows you to override YouTube's configuration by using the youtube
object in the settings. Check Supported parameters section for more details.
Example
<!DOCTYPE html>
<html lang="en">
<body>
<video class="op-player__media" id="video" controls playsinline>
<source src="https://www.youtube.com/watch?v=xcJtL7QggTI" type="video/x-youtube">
</video>
<script src="https://cdn.jsdelivr.net/npm/openplayerjs@latest/dist/openplayer.min.js"></script>
<script src="/path/to/openplayerjs-youtube.min.js"></script>
<script>
var player = new OpenPlayer('video', null, false, {
youtube: {
// config
}
});
player.init();
</script>
</body>
</html>