- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遵循与 DASH 视频一起使用的 shaka 的基本用法,但在尝试加载 M3U8 时抛出错误代码 4032。
import * as muxjs from 'mux.js';
import * as shaka from 'shaka-player';
export class AppComponent implements AfterViewInit {
@ViewChild('videoPlayer') videoElementRef: ElementRef;
videoElement: HTMLVideoElement;
manifestUri = 'http://hlsliveamdgl7-lh.akamaihd.net/i/hlsdvrlive_1@583042/master.m3u8';
ngAfterViewInit() {
shaka.polyfill.installAll();
this.videoElement = this.videoElementRef.nativeElement;
this.initPlayer();
}
private initPlayer() {
shaka.media.ManifestParser.registerParserByExtension("m3u8", shaka.hls.HlsParser);
shaka.media.ManifestParser.registerParserByMime("Application/vnd.apple.mpegurl", shaka.hls.HlsParser);
shaka.media.ManifestParser.registerParserByMime("application/x-mpegURL", shaka.hls.HlsParser);
let player = new shaka.Player(this.videoElement);
player.load(this.manifestUri).then(() => {
// This runs if the asynchronous load is successful.
console.log('The video has now been loaded!');
}).catch(this.onError); // onError is executed if the asynchronous load fails.
}
模板是
<video #videoPlayer
id="video"
width="640"
poster="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png"
controls> </video>
相关的 Angular 9 依赖项是
"shaka-player": "^3.0.1",
并且还安装了(可能是不必要的)
"hls.js": "^0.13.2",
"mux.js": "^5.6.4",
它在 Safari 上有效,但在 Chrome 上无效。我想我遗漏了一些与 mux.js 相关的东西。
有什么提示吗?非常感谢!
最佳答案
事实证明,只需添加这个就可以了
<script src="https://github.com/videojs/mux.js/releases/latest/download/mux.js"></script>
到 Angular 的 index.html。导入不起作用。无需进行额外配置。 Shaka 会检测到它并使用它。
但如我所愿keep the dependency inside the app .我将 js 复制到 Assets 文件夹 ( as referencing from node modules does not work 。
<script defer src="assets/mux.min.js"></script>
遗憾的是,从 angular.json 脚本引用也不起作用。
关于angular - 在 Chrome 上使用 Shaka Player 播放 HLS m3u8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62596654/
此时我的解决方案正在运行,但仅作为 RTMP,我可以使用 URL 完美地观看我的流: rtmp://X.X.X.X:1935/show/name 但问题是我使用 WebOS 的 LG 智能电视不支持
将 hls 流重新混合为 mp4 文件时,我使用以下命令。 ffmpeg -i "http://example.com/master.m3u8" -c copy -bsf:a aac_adtstoas
我正在使用 Hls.js 将视频管理到我的 HTML 页面中。我需要构建一个音量计来告知用户视频的音频电平。由于我需要保留 video.muted = true,我想知道 Hls.js 是否有任何方法
我正在构建一个视频播放器,它需要播放 HLS 直播和点播流。 它似乎只在 Safari 中运行良好。 (减去我需要更新的自定义样式,忽略它) 在所有其他浏览器中,我收到此错误: VIDEOJS: ER
原始视频是来自 https://www.appsloveworld.com/download-sample-mp4-video-mp4-test-videos/ 的“示例视频 5” . 我的 /hom
我正在直播mp3流(可能它正在使用 icecast - 管理员要求我在另一台服务器上重新广播它)。我正在使用 ffmpeg对于这个任务,使用 HLS播放列表,公开URL地点。 有用!但有时(我的意思是
我正在使用最新的 hls.js 1.0.0(不是 rc)流式传输 .m3u8,但版本为 2021-04-01... 例如:直播从下午 5 点开始,现在是下午 5 点 15 分... 几乎所有浏览器中的
我正在尝试实现具有 3 种视频质量和一种音频质量的自适应流媒体。愿景是带宽减少时切换到仅音频。但由于某种原因,仅播放仅音频文件。它没有切换到任何其他质量。我在客户端使用 exoplayer。 这是主m
我在仅播放音频的 Android 上播放 HLS 时遇到困难。该流将播放第一个视频 fragment ,然后变成仅音频流。这是一个示例链接 https://clipter.com/c/aymels8/
在我的代码中,我试图生成 m3u8不同质量的我的单个视频的格式。我的代码能够生成m3u8但没有品质,它采用原始框架高度和宽度而不是我定义的框架。我对它进行了研究,但我无法完成正确的目标。因为我是 ff
我正在尝试将具有多个音频流的一些视频(不同格式,例如 mp4、mkv、avi)转换为只有一个音频的 HLS。我用 ffmpeg 尝试了不同的解决方案,但似乎没有一个是理想的。 例如 ffmpeg -i
我将视频转码为 HLS,使用以下命令一切正常: ffmpeg -i source -vcodec nvenc -acodec copy -f ssegment -segment_list playli
我们正在使用 JWPlayer 8.9.0,我们正在尝试在我们的视频中插入广告。 我们正在使用 EXT-X-DISCONTINUITY但显然,当我们开始转换广告时,播放器停止显示缓冲状态。 这是我们播
使用最近的 ffmpeg 主分支(commit 7fcbeb),我们可以使用生成主播放列表 -master_pl_name 选项。但我无法生成具有不同配置文件的主播放列表。尝试使用 -var_stre
使用 avformat_open_input 打开 HLS 流从所有流中检索数据,我只想从其中一些流中检索数据。那可能吗? 考虑以下 MWE: #include int main(int argc,
这可能不是一个纯粹的技术问题,但不能确定放置它的最佳位置。 因此,我们有一个直播网站(请考虑MTV)。我们使用HTTP Live Streaming交付内容。因此,视频流由一堆视频组成。我们希望对此进
HLS 协议(protocol)是否指定音频编解码器?如果支持,支持哪些? 我尝试搜索,但找到了不同的列表: MP3, HE-AAC or AC-3 根据 wikipedia AAC, AAC-LC,
我正在尝试在 iOS 中进行直播,因此遵循以下步骤 - 初始化播放器 player = AVPlayer() player.rate = 1.0
我使用 MPMoviePlayer、MPMovieAccessLogEvent 从服务器获取比特率文件视频 hls,我计算如下: double bitrate = 8 * event.observed
目前我正在使用 Kintex 7 和 microblaze 来实现伪随机位序列功能。我已经在HLS中执行了PRBS并创建了HLS IP,然后将HLS IP与vivado集成,生成比特流并将其导出到SD
我是一名优秀的程序员,十分优秀!