video-clip.js 840 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. exports.template = /* html */`
  3. <section class="asset-video-clip">
  4. </section>
  5. `;
  6. exports.style = /* css */`
  7. .asset-video-clip {
  8. margin-bottom: 8px;
  9. }
  10. .asset-video-clip .video {
  11. width: 100%;
  12. outline: none;
  13. }
  14. `;
  15. exports.$ = {
  16. container: '.asset-video-clip',
  17. };
  18. exports.update = function(assetList, metaList) {
  19. // Support multi-select list display, limit the number of display
  20. let html = '';
  21. const maxShowNumber = 1000;
  22. assetList.forEach((asset, index) => {
  23. if (!asset.file || index > maxShowNumber) {
  24. return;
  25. }
  26. if (assetList.length > 1) {
  27. html += `<div>${asset.name}</div>`;
  28. }
  29. html += `<video class="video" controls="controls" src="${asset.file}?v=${Date.now()}"></video>`;
  30. });
  31. this.$.container.innerHTML = html;
  32. };