- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
HLS (HTTP Live Streaming)是Apple公司研发的流媒体传输技术,包括一个m3u8的索引文件、多个ts分片文件和key加密串文件。这项技术主要应用于点播和直播领域。
开源JS库(Github):
【video.js】https://github.com/videojs/videojs-contrib-hls
【hls.js】https://github.com/video-dev/hls.js/
腾讯视频SDK(TCPlayerLite),文档地址:https://cloud.tencent.com/document/product/881/20207
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>videojs-contrib-hls embed</title>
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
<script src="https://unpkg.com/video.js/dist/video.js"></script>
<script src="https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"></script>
</head>
<body>
<h1>Video.js Example Embed</h1>
<video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268"
data-setup='{}'>
<source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">
</video>
<script>
</script>
</body>
</html>
注:可以指定多个source标签。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>前端播放m3u8格式视频</title>
<link href="https://vjs.zencdn.net/7.4.1/video-js.css" rel="stylesheet">
<script src='https://vjs.zencdn.net/7.4.1/video.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.15.0/videojs-contrib-hls.min.js" type="text/javascript"></script>
<!-- videojs-contrib-hls 用于在电脑端播放 如果只需手机播放可以不引入 -->
</head>
<body>
<style>
.video-js .vjs-tech {position: relative !important;}
</style>
<div>
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" data-setup='{}' style='width: 100%;height: auto'>
<source id="source" src="http://1252093142.vod2.myqcloud.com/4704461fvodcq1252093142/48c8a9475285890781000441992/playlist.m3u8" type="application/x-mpegURL"></source>
</video>
</div>
<div class="qiehuan" style="width:100px;height: 100px;background: red;margin:0 auto;line-height: 100px;color:#fff;text-align: center">切换视频</div>
</body>
<script>
// videojs 简单使用
var myVideo = videojs('myVideo', {
bigPlayButton: true,
textTrackDisplay: false,
posterImage: false,
errorDisplay: false,
})
myVideo.play()
var changeVideo = function (vdoSrc) {
if (/\.m3u8$/.test(vdoSrc)) { //判断视频源是否是m3u8的格式
myVideo.src({
src: vdoSrc,
type: 'application/x-mpegURL' //在重新添加视频源的时候需要给新的type的值
})
} else {
myVideo.src(vdoSrc)
}
myVideo.load();
myVideo.play();
}
var src = 'http://1252093142.vod2.myqcloud.com/4704461fvodcq1252093142/f865d8a05285890787810776469/playlist.f3.m3u8';
document.querySelector('.qiehuan').addEventListener('click', function () {
changeVideo(src);
})
</script>
第一步: 直接安装 兼容7.0 video.js
npm install vue-video-player videojs-contrib-hls --save
第二步: main.js 引入video-js.css
import 'video.js/dist/video-js.css'
第三步:组件页面
<template>
<div style="padding-top: 30px; width: 100%; height: 360px; position: relative;">
<video
id="video"
preload="auto"
muted
class="video-js vjs-default-skin"
style="width: 100%; height: 100%; object-fit: fill"
>
<source src="http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8" type="application/x-mpegURL" />
</video>
</div>
</template>
<script>
import videojs from 'video.js'
import 'videojs-contrib-hls'
export default {
mounted () {
this.$nextTick(() => {
this.getVideo()
})
},
methods: {
getVideo () {
videojs('video', {
bigPlayButton: true,
textTrackDisplay: false,
posterImage: false,
errorDisplay: false,
controls: true,
hls: {
withCredentials: true
}
}, function () {
this.play()
})
}
}
}
</script>
1、验证m3u8视频地址是否可用的工具
2、主要参考链接:vue组件播放m3u8格式视频
3、其他参考链接:Vue Video.js播放m3u8视频流格式(video+videojs-contrib-hl)
4、video.js官网链接
在过去的几个月里,我一直在研究 Haskell,我遇到了一个我不太确定如何处理的单子(monad)的情况。 我有一个 a -> m a 类型的值第二个类型为 m (a -> a)我需要对它们进行组合,
仿函数有 (a -> b) -> m a -> m b 应用程序有 f (a -> b) -> f a -> f b Monad 有 m a -> (a -> m b) -> m b 但是,是否有扩展
我是 Haskell 的新手,我想知道是否有比 Hoogle 更好的方法来确定一个库功能是否重复? 举个例子:我有很多函数f :: Monad a => a -> m a我想链接在一起,比如 f123
将存储在一系列列表中的 m、m、n 维数组组合成一个 m、m、n 维数组的方法是什么? 示例: 这是三个包含 m,m,n 维数组的列表: list1 <- array (1, dim = c(5, 5
有没有办法写一个函数f::(a -> b -> ... -> t) -> (Monad m => m a -> m b -> ... -> m t ),基本上是 liftMn 对于任何 n? (编辑:
我有一个像这样的 pandas 数据框: df = pd.DataFrame({'A':[1,3,2,9],'B':[2,1,2,7],'C':[7,2,4,6],'D':[8,1,6,4]},ind
这个问题来自文章“Trivial Monad”,地址:http://blog.sigfpe.com/2007/04/trivial-monad.html 。提供的答案是 h x y = x >>= (
所以>>= :: m a -> (a -> m b) -> m b和>> :: m a -> m b -> m b . 而 f b -> f a . 但我想要一些能m a -> (a -> m b)
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 3 年前。 Improve
当我安装 rakudo来源: $ git clone git@github.com:rakudo/rakudo.git $ cd rakudo $ perl Configure.pl --gen-mo
我正在尝试通过查看一些练习来提高我的 Idris 技能 Software Foundations (最初是为 Coq 设计的,但我希望对 Idris 的翻译不会太糟糕)。我在使用 "Exercise:
我想知道以下是否可行。 与服务器交换密码时,应保护密码。因此,用户可以使用生成的 key kUser 来加密密码。 Encrypt(m, kUser) 生成加密消息 eU(m)。现在用户将此信息发送到
这两个表之间存在什么样的关系(1:1、1:m、m:m,等等)? CREATE TABLE IF NOT EXISTS `my_product` ( `id` int(11) NOT NULL au
有人可以解释类型的含义以及如何实现吗? class Foldable f where foldMap :: (Monoid m) => (a -> m) -> f a -> m 基于 https:
例如,在 MVC 应用程序中,我可以使用 Html 助手来创建这样的标签: @Html.LabelFor(m => m.ProductName) 我没有在任何地方声明变量“m”,但 IDE 会自动找出
更新:澄清、更明确的重点和缩短的示例: 我可以避免 M op+(M&&,M&&) 过载吗?假设,我想很好地处理 RValues?我想其他三个重载是必需的。 我首先使用 (&&,&&) 重载的原因: 通
假设我有一个函数,它接受两个向量并返回一个整数,例如一个向量中也存在另一个向量中的元素数量。喜欢: f m [,1] [,2] [,3] [1,] "c" "i" "c" [2,] "
我想将字符串(字幕)转换为: 585 00:59:59,237 --> 01:00:01,105 - It's all right. - He saw us! 586 01:00:01,139 -->
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预
是否可以将 Linux 中的大文件将 d.m.Y h:m:s 转换为 Y-d-m h:m:s? 示例数据 "30.07.2016 00:00:00",DN123,PAPN,PAPN,TEST,9189
我是一名优秀的程序员,十分优秀!