1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-27 06:59:59 +04:00
Files
tabler/preview/pages/_includes/ui/inline-player.html

19 lines
647 B
HTML

{% assign id = include.id %}
{% if id and include.embed-id %}
<div id="player-{{ id }}" data-plyr-provider="{{ include.type | default: 'youtube' }}" data-plyr-embed-id="{{ include.embed-id }}"></div>
{% capture_global scripts %}
<script>
// @formatter:off
document.addEventListener("DOMContentLoaded", function () {
{% if environment == 'development' %}
window.tabler_player = window.tabler_player || {};
{% endif %}
window.Plyr && ({% if environment == 'development' %}window.tabler_player["player-{{ id }}"] = {% endif %}new Plyr('#player-{{ id }}'));
});
// @formatter:on
</script>
{% endcapture_global %}
{% endif %}