Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

xgplayer-encrypt-mp4

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xgplayer-encrypt-mp4

xgplayer encrypt plugin for mp4

latest
npmnpm
Version
1.2.4
Version published
Maintainers
2
Created
Source

加密MP4播放插件

安装

npm i xgplayer
npm i xgplayer-encrypt-mp4

使用方式

通过 kid 播放

import 'xgplayer'
import Mp4Player from 'xgplayer-encrypt-mp4'

let player = new Mp4Player({
  id: 'vs',
  url: 'xxx',
  vid: 'xxx',
  kid: 'xxx'
});

通过 keyValue 播放

import 'xgplayer'
import Mp4Player from 'xgplayer-encrypt-mp4'

let player = new Mp4Player({
  id: 'vs',
  url: 'xxx',
  vid: 'xxx',
  keyValue: 'xxx'
});

使用经过加密的 secretKey 播放

import 'xgplayer'
import Mp4Player from 'xgplayer-encrypt-mp4'

let player = new Mp4Player({
  id: 'vs',
  url: 'xxx',
  secretKey: 'xxx',
  withCredentials: true //支持请求携带cookie
});

通过传 drm 的方式播放

import 'xgplayer'
import Mp4Player from 'xgplayer-encrypt-mp4'

let player = new Mp4Player({
  id: 'vs',
  url: 'xxx',
  vid: 'xxx',
  drm: {
    clearKeys: {
      'xxx': 'xxx'
    }
  }
});

其它播放器配置参数和API使用请参考 http://h5player.bytedance.com/config/

兼容性

判断是否支持播放

Mp4Player.isSupported()

Android 4.4 以上 IOS 13 以上

Keywords

mp4

FAQs

Package last updated on 25 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts