Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.2.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by250%
Maintainers
2
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc