inline-player.html 663 B

123456789101112131415161718192021
  1. {% assign id = include.id %}
  2. {% if id and include.embed-id %}
  3. <div id="player-{{ id }}" data-plyr-provider="{{ include.type | default: 'youtube' }}" data-plyr-embed-id="{{ include.embed-id }}"></div>
  4. {% comment %}
  5. {% capture_global scripts %}
  6. <script>
  7. // @formatter:off
  8. document.addEventListener("DOMContentLoaded", function () {
  9. {% if env == 'development' %}
  10. window.tabler_player = window.tabler_player || {};
  11. {% endif %}
  12. window.Plyr && ({% if env == 'development' %}window.tabler_player["player-{{ id }}"] = {% endif %}new Plyr('#player-{{ id }}'));
  13. });
  14. // @formatter:on
  15. </script>
  16. {% endcapture_global %}
  17. {% endcomment %}
  18. {% endif %}