0.7.4 • Published 3 years ago

yz-player-sdk v0.7.4

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

影子视频直播接入组件

版本0.x.x

支持ReactVue项目通过npm引入,原生Html通过引入script标签进行实例化调用

参数

参数说明
typestring必填 字符串 海康:haikang 乐橙:lecheng
urlstring必填 视频播放地址
containerstring必填 视频容器,内部播放器自适应宽高(按照宽度,等比缩放高度),设置容器宽度即可控制播放器大小
kitTokenstring非必填 仅乐橙需要,如果海康调用,可以不填

使用方式

第一步:

yarn add yz-player-sdk
或
npm install yz-player-sdk

第二步: 如需乐橙云,需要引入乐橙云必要文件(乐橙云sdk集成方式及同源策略限制,需将必要文件上传至项目服务器) 将imouplayer.js和static文件夹直接拷贝至入口文件同层目录下(文件夹名固定为static不可修改为其他名称) 文件地址 https://github.com/xueyy/resources/tree/main

react:

import React, { useEffect } from 'react';
import { init } from 'yz-player-sdk';

const Demo = () => {
  useEffect(() => {
    init({
      type: 'haikang', // 必填 字符串 haikang = 海康或 lecheng = 乐橙
      url:'https://open.ys7.com/v3/openlive/G22188122_1_1.m3u8?expire=1625650510&id=332912439701385216&t=4ea00078f065d826c3991f7f4e050eef20d992c265795113e53c46c511222fa3&ev=100', // 必填 视频播放地址
      container: 'myplayer', // 必填 视频容器,内部播放器自适应宽高(按照宽度,等比缩放高度),设置容器宽度即可控制播放器大小
      kitToken:'keycode', // 非必填 仅乐橙需要,如果海康调用,可以不填
    });
  }, []);
  return (<div id="myplayer" style={{ width: '100%', textAlign: 'center' }}></div>)
}

export default Demo

vue:

<template>
  <div id="app">
    <div id="myplayer" style="{ width: '100%', textAlign: 'center' }"></div>
  </div>
</template>

<script>
import { init } from "yz-player-sdk";
export default {
  name: "App",
  components: {
    HelloWorld,
  },
  mounted: function () {
    init({
      type: "haikang", // 必填 字符串 haikang = 海康或 lecheng = 乐橙
      url: "https://open.ys7.com/v3/openlive/G22188122_1_1.m3u8?expire=1625650510&id=332912439701385216&t=4ea00078f065d826c3991f7f4e050eef20d992c265795113e53c46c511222fa3&ev=100", // 必填 视频播放地址
      container: "myplayer", // 必填 视频容器,内部播放器自适应宽高(按照宽度,等比缩放高度),设置容器宽度即可控制播放器大小
      kitToken: "keycode", // 非必填 仅乐橙需要,如果海康调用,可以不填
    });
  },
};
</script>

html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        width: "100%";
        text-align: center;
      }
    </style>
  </head>
  <body>
    <div id="myplayer" classname="container"></div>
  </body>
  <script type="module">
    import { init } from "./index.min.js";
    window.onload = function() {
      init({
        type: "lecheng",
        url:
          "https://open.ys7.com/v3/openlive/G22188122_1_1.m3u8?expire=1625650510&id=332912439701385216&t=4ea00078f065d826c3991f7f4e050eef20d992c265795113e53c46c511222fa3&ev=100",
        container: "myplayer",
        kitToken: "123",
      });
    };
  </script>
</html>

index.js

<sciprt src="https://cdn.jsdelivr.net/gh/xueyy/Player-sdk@master/index.js"></script>

海康开发文档 https://open.ys7.com/doc/zh/

乐橙云开发文档 https://open.imoulife.com/book/zh

0.7.4

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.18

3 years ago

0.6.17

3 years ago

0.6.19

3 years ago

0.6.16

3 years ago

0.6.15

3 years ago

0.6.14

3 years ago

0.6.12

3 years ago

0.6.11

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.9

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.9

3 years ago

0.6.8

3 years ago

0.6.10

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.5

3 years ago

0.5.2

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.5

3 years ago

0.6.4

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.20

3 years ago

0.4.21

3 years ago

0.4.28

3 years ago

0.4.29

3 years ago

0.4.26

3 years ago

0.4.27

3 years ago

0.4.24

3 years ago

0.4.25

3 years ago

0.4.22

3 years ago

0.4.23

3 years ago

0.4.19

3 years ago

0.4.10

3 years ago

0.4.17

3 years ago

0.4.18

3 years ago

0.4.15

3 years ago

0.4.16

3 years ago

0.4.13

3 years ago

0.4.14

3 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.5.0

3 years ago

1.3.28

3 years ago

1.3.29

3 years ago

1.3.26

3 years ago

1.3.27

3 years ago

1.3.31

3 years ago

1.3.32

3 years ago

1.3.30

3 years ago

1.3.35

3 years ago

1.3.33

3 years ago

1.3.34

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

1.3.10

3 years ago

1.3.13

3 years ago

1.3.14

3 years ago

1.3.11

3 years ago

1.3.12

3 years ago

1.3.17

3 years ago

1.3.18

3 years ago

1.3.15

3 years ago

1.3.16

3 years ago

1.3.19

3 years ago

1.3.20

3 years ago

1.3.21

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.24

3 years ago

1.2.12

3 years ago

1.3.25

3 years ago

1.2.13

3 years ago

1.3.22

3 years ago

1.2.10

3 years ago

1.3.23

3 years ago

1.2.11

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.0

3 years ago

1.2.8

3 years ago

1.1.9

3 years ago

1.2.7

3 years ago

1.1.8

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago