阿里云视频播放器整合与学习

1、根据视频地址播放

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.1/skins/default/aliplayer-min.css" />
    <script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.8.1/aliplayer-min.js"></script>
    <div  class="prism-player" id="J_prismPlayer"></div>

    <script>
        var player = new Aliplayer({
            id: 'J_prismPlayer',
            width: '100%',
            autoplay: false,
            cover: 'http://liveroom-img.oss-cn-qingdao.aliyuncs.com/logo.png',  
            //播放配置
            source : 'https://outin-330daf7945c511eab0c600163e1c35d5.oss-cn-shanghai.aliyuncs.com/sv/20bd2acc-1730b0b8921/20bd2acc-1730b0b8921.mp4?Expires=1594019827&OSSAccessKeyId=LTAI3DkxtsbUyNYV&Signature=IaW3gDBLw%2Fk0%2FHHf4lVyu2Fu8YU%3D',
        },function(player){
            console.log('播放器创建好了。')
        });
    </script>

</body>

</htm

l>

2 根据播放凭证播放

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.1/skins/default/aliplayer-min.css" />
    <script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.8.1/aliplayer-min.js"></script>
    <div class="prism-player" id="J_prismPlayer"></div>

    <script>
        var player = new Aliplayer({
            id: 'J_prismPlayer',
            width: '100%',
            autoplay: false,
            cover: 'http://liveroom-img.oss-cn-qingdao.aliyuncs.com/logo.png',
            //播放配置
            encryptType: '1',//如果播放加密视频,则需设置encryptType=1,非加密视频无需设置此项
            vid: '52d80ae859244bdc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
        }, function (player) {
            console.log('播放器创建好了。')
        });
    </script>

</body>

</html>

3、视频播放凭证有时效,默认时长100秒

java 复制代码
//播放凭证有过期时间,默认值:100秒 。取值范围:100~3000。
//request.setAuthInfoTimeout(200L);
相关推荐
Amarantine、沐风倩✨13 分钟前
设计一个监控摄像头物联网IOT(webRTC、音视频、文件存储)
java·物联网·音视频·webrtc·html5·视频编解码·七牛云存储
路在脚下@1 小时前
spring boot的配置文件属性注入到类的静态属性
java·spring boot·sql
啦啦右一1 小时前
Spring Boot | (一)Spring开发环境构建
spring boot·后端·spring
森屿Serien1 小时前
Spring Boot常用注解
java·spring boot·后端
苹果醋32 小时前
React源码02 - 基础知识 React API 一览
java·运维·spring boot·mysql·nginx
Hello.Reader3 小时前
深入解析 Apache APISIX
java·apache
盛派网络小助手3 小时前
微信 SDK 更新 Sample,NCF 文档和模板更新,更多更新日志,欢迎解锁
开发语言·人工智能·后端·架构·c#
菠萝蚊鸭3 小时前
Dhatim FastExcel 读写 Excel 文件
java·excel·fastexcel
旭东怪3 小时前
EasyPoi 使用$fe:模板语法生成Word动态行
java·前端·word
007php0073 小时前
Go语言zero项目部署后启动失败问题分析与解决
java·服务器·网络·python·golang·php·ai编程