npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@volcengine/vecasterplayer

v0.0.2

Published

火山引擎-云导播预览WebSDK

Downloads

4

Readme

@volcengine/vecasterplayer

云导播 RTC 播放器

使用流程

业务方接入 服务端NodeSDK 计算 Token, 传入给 WebSDK

鉴权

业务方在node层 使用 github/volcengine/volc-sdk-nodejs 获得 UserToken ,将 UserToken 传入给SDK初始化以及更新Token更新

web 引入

import {
    CasterPlayerRoom, 
    CasterPlayerContentEnum,
    CasterEvent,
} from "@volcengine/vecasterplayer"

// 创建 room 实例
const room = new CasterPlayerRoom({
  UserToken: UserToken,
  CasterID: 1,
})

// Token 更新
room.on(CasterEvent.onUserTokenExpired, async ()=>{
    const NewUserToken = await fetchUserToken()
    room.refreshToken(NewUserToken)
})

// 进云导播房间(必须要进入房间才能创建播放器播放)
room.enterRoom()
// 退出云导播房间(销毁各种副作用)
room.leaveRoom()


// 创建播放器 -> 建立DOM
room.createPlayer(CasterPlayerContentEnum.PVW, divDOM)
// 返回player原生DOM

// 销毁播放器
room.destroyPlayer(CasterPlayerContentEnum.PVW)

// 取消禁音
room.unmuteStreamAudio(CasterPlayerContentEnum.PVW)
// 禁音
room.muteStreamAudio(CasterPlayerContentEnum.PVW)

枚举

enum CasterPlayerContentEnum {
  PVW, PGM, RES_1, RES_2, RES_3, RES_4, RES_5, RES_6
}

enum CasterEvent {
  onUserTokenExpired 
}

类型

type UserToken =  {
    AccessKeyId: string;
    SecretAccessKey: string;
    CurrentTime: string;
    ExpiredTime: string;
    SessionToken: string;
}

type CasterID = number