如何使 videogular2 HLS 在 IOS 上工作?
How to make videogular2 HLS working on IOS?
我正在使用 videogular2 在 Angular 6 上显示 HLS。它在桌面或 Android 手机上工作,但我在 IOS 上出现以下错误:
TypeError: undefined is not an object (evaluating 'this.medias.toArray()[0].elem')
这是我的模板:
<div>
<vg-player>
<video [vgHls]="url" id="singleVideo" controls crossorigin>
</video>
</vg-player>
</div>
使用的版本:
"hls.js": "^0.11.0",
"videogular2": "^6.3.0"
想办法让它发挥作用。似乎是导致错误的基本控件。添加自定义控件可解决问题:
<vg-player>
<vg-overlay-play></vg-overlay-play>
<vg-buffering></vg-buffering>
<vg-controls>
<vg-play-pause vgFor="singleVideo"></vg-play-pause>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
<vg-scrub-bar-buffering-time></vg-scrub-bar-buffering-time>
</vg-scrub-bar>
<vg-time-display vgProperty="left" vgFormat="mm:ss"></vg-time-display>
<vg-mute></vg-mute>
<vg-volume></vg-volume>
<vg-fullscreen></vg-fullscreen>
</vg-controls>
<video #media [vgMedia]="media" [vgHls]="url" id="singleVideo" autoplay>
</video>
我正在使用 videogular2 在 Angular 6 上显示 HLS。它在桌面或 Android 手机上工作,但我在 IOS 上出现以下错误:
TypeError: undefined is not an object (evaluating 'this.medias.toArray()[0].elem')
这是我的模板:
<div>
<vg-player>
<video [vgHls]="url" id="singleVideo" controls crossorigin>
</video>
</vg-player>
</div>
使用的版本:
"hls.js": "^0.11.0",
"videogular2": "^6.3.0"
想办法让它发挥作用。似乎是导致错误的基本控件。添加自定义控件可解决问题:
<vg-player>
<vg-overlay-play></vg-overlay-play>
<vg-buffering></vg-buffering>
<vg-controls>
<vg-play-pause vgFor="singleVideo"></vg-play-pause>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
<vg-scrub-bar-buffering-time></vg-scrub-bar-buffering-time>
</vg-scrub-bar>
<vg-time-display vgProperty="left" vgFormat="mm:ss"></vg-time-display>
<vg-mute></vg-mute>
<vg-volume></vg-volume>
<vg-fullscreen></vg-fullscreen>
</vg-controls>
<video #media [vgMedia]="media" [vgHls]="url" id="singleVideo" autoplay>
</video>