• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cycjimmy / h5-video-player / 10950507631

19 Sep 2024 11:35PM UTC coverage: 78.723%. Remained the same
10950507631

Pull #388

github

web-flow
Merge bbc06d415 into 417485361
Pull Request #388: chore(deps-dev): bump sass from 1.78.0 to 1.79.2

66 of 82 branches covered (80.49%)

Branch coverage included in aggregate %.

82 of 106 relevant lines covered (77.36%)

4.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/templates/wrapper.js
1
import isArray from '@cycjimmy/awesome-js-funcs/esm/judgeBasic/isArray';
2
import isObject from '@cycjimmy/awesome-js-funcs/esm/judgeBasic/isObject';
3
import isString from '@cycjimmy/awesome-js-funcs/esm/judgeBasic/isString';
4

5
/**
6
 * wrapper
7
 * @param style
8
 * @param source
9
 * @param orientation
10
 * @returns {string}
11
 */
12
export default ({
13
  style,
14
  source,
15
  orientation,
16
}) => {
17
  /**
18
   * handleSourceHtml
19
   * @returns {string|*}
20
   */
21
  const handleSourceHtml = () => {
8✔
22
    if (isArray(source)) {
8✔
23
      return source
2✔
24
        .map((s) => `<source src="${s.url}" type="video/${s.type}">`)
2✔
25
        .reduce((previous, current) => previous + current, '');
2✔
26
    }
27
    if (isObject(source)) {
6✔
28
      return `<source src="${source.url}" type="video/${source.type}">`;
2✔
29
    }
30
    if (isString(source)) {
4✔
31
      return `<source src="${source}">`;
2✔
32
    }
33
    return '';
2✔
34
  };
35

36
  return `
8✔
37
<div class="${style.videoWrapperForConstraintRatio}">
38
  <video class="${style.video}" width="100%" preload="auto"
39
  x-webkit-airplay="allow" webkit-playsinline="true" playsinline
40
  x5-video-player-type="h5" x5-video-player-fullscreen="true"
41
  x5-video-orientation="${orientation}">
42
    ${handleSourceHtml(source)}
43
    I'm sorry; your browser doesn't support HTML5 video.
44
  </video>
45
</div>
46
`;
47
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc