inline-player.html 600 B

1234567891011121314151617
  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. {% capture_script %}
  5. <script>
  6. document.addEventListener("DOMContentLoaded", function () {
  7. {% if environment == 'development' %}
  8. window.tabler_player = window.tabler_player || {};
  9. {% endif %}
  10. window.Plyr && ({% if environment == 'development' %}window.tabler_player["player-{{ id }}"] = {% endif %}new Plyr('#player-{{ id }}'));
  11. });
  12. </script>
  13. {% endcapture_script %}
  14. {% endif %}