caption-evaluate.js 440 B

12345678910111213
  1. import { querySelectorAll } from '../../core/utils';
  2. function captionEvaluate(node, options, virtualNode) {
  3. const tracks = querySelectorAll(virtualNode, 'track');
  4. const hasCaptions = tracks.some(vNode => {
  5. return (vNode.attr('kind') || '').toLowerCase() === 'captions';
  6. });
  7. // Undefined if there are no tracks - media may use another caption method
  8. return hasCaptions ? false : undefined;
  9. }
  10. export default captionEvaluate;