Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alicloud-apsara

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alicloud-apsara

A library for AliCloud live-streaming platform - Apsara

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

alicloud-apsara

Build Status Coverage Status

This is a library for integrating with AliCloud live-streaming platform - Apsara.

Integration progress:

  • get domains
  • generate ingest/streaming url with signature
  • forbid ingest url
  • TBD

How to use

import { Apsara, ApsaraDomainsData } from 'alicloud-apsara'

const apsara = new Apsara({
  accessKeyId: 'keyId',
  accessKeySecret: 'keySecret'
})

// fetch domains from apsara
const domainsData: ApsaraDomainsData = await apsara.getDomains()
// Domains: {
//   PageData: [
//     {
//       Description: '',
//       LiveDomainStatus: 'online',
//       DomainName: 'live-ingest.upstra-china.cc',
//       LiveDomainType: 'liveEdge',
//       RegionName: 'ap-southeast-1',
//       GmtModified: '2020-09-14T14:31:23Z',
//       GmtCreated: '2020-09-14T14:27:06Z',
//       Cname: 'live-ingest.upstra-china.cc.w.alikunlun.com'
//     }
//   ]
// },
// TotalCount: 8,
// RequestId: '0500D05A-505D-49B1-B989-BDC9FDAB9BAD',
// PageSize: 20,
// PageNumber: 1

// forbid a streaming
const res: ApsaraResponseData = await apsara.terminateStreamingUrl({
  domain: 'test',
  appName: 'test',
  streamName: 'test',
  oneshot: 'yes', // 'yes'/'no', yes - only forbid without adding to blacklist
  resumeTime: '2021-02-24T17:59:19Z'
})
// RequestId: '0500D05A-505D-49B1-B989-BDC9FDAB9BAD',

Specs

Apsara(options [,logger])
  • options, required
    • accessKeyId: string, required
    • accessKeySecret: string, required
    • baseUrl?: string, by default 'https://live.aliyuncs.com'
    • timeout?: number, by default 3000
    • version?: string, by default '2016-11-01'
    • signatureMethod?: string, by default 'HMAC-SHA1'
    • signatureVersion?: string, by default '1.0'
    • format?: string, by default 'json'
  • logger, optional, WinstonLogger/BunyanLogger/Console
Methods (TBD)
  • Apsara.getDomains()
  • Apsara.getIngestUrl({ domain: string appName: string streamName: string expiredIn: number key: string })
  • Apsara.getVideoStreamingUrl({ domain: string appName: string streamName: string expiredIn: number // seconds key: string format: string // 'rtmp' | 'flv' | 'm3u8' | 'udp' isSecure: boolean })
  • Apsara.terminateStreamingUrl({ domain: string appName: string streamName: string oneshot?: string resumeTime?: string // "yyyy-MM-dd'T'HH:mm:ss'Z'" })

How to test

yarn
yarn test

MIT License

Keywords

FAQs

Package last updated on 17 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