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

live-raylink

v1.0.5

Published

ray-streaming launcher for raylink

Downloads

13

Readme

Raylink RayStreaming Launcher

RayStreaming launcher

Quick start

Initial params

interface ClientInfo {
  token: string // auth info
  account: string // username
  endpoint: string // backend socket endpoint
  fingerprint: string // browser fingerprint
  machineName: string // specify at will
  professional: boolean // license type
}
enum LogLevel {
  log = 0,
  info = 1,
  warn = 2,
  error = 3,
}
class Sentry {
  static LogLevel = LogLevel
  constructor(
    clientInfo: ClientInfo,
    options?: {
      logLevel?: LogLevel // default: LogLevel.log
      dbName?: string // database name of persistence log. default: avica-log-db
    },
  )
}

// example
import { Sentry } from 'live-raylink'

const sentryIns = new Sentry(
  {
    token: 'rsat:xxxx',
    account: 'anonymous',
    endpoint: 'wss://raylink.live',
    fingerprint: 'xxxx',
    machineName: "somebody's MacBook",
    professional: true,
  },
  {
    logLevel: Sentry.LogLevel.warn,
    dbName: 'awesome-db-name',
  },
)

Event

use as below, payload type refers to the export type in package

sentryIns.eventBus.subscribe('event_name', handler)

| Event name | Desc | Payload | | --------------------- | -------------------------------------------------- | ----------------------------------------------------------------------------- | | peer_disconnected | emit when peer closed the connection | string | | group_received | emit when group received | GroupItem[] | | device_received | emit when device received | DeviceItem[] | | push_message | server push | PushMessage | | license_changed | server push | LicenseChanged | | connect_state_changed | emit when state changes of connection with backend | ConnectState | | monitor_count_changed | emit when peer monitor count changed | { count: number; deviceId: string } | | codec_changed | emit when peer codec options changed | { bitrate: number; framerate: number; gopLength: number; deviceId: string } | | ice_state_changed | emit when ICE connect state changed | { state: RTCIceConnectionState; deviceId: string } | | error | emit when socket/WebRTC/Logic blocked with error | { source: ErrorSource; reason: ErrorReason; code?: ValueOf<error_codeMap> } |

Methods

prepare
import { GroupType } from 'live-raylink'

// fetch all group info
sentryIns.getGroupList()
// fetch all device info
sentryIns.getDeviceList(GroupType.Root)
// fetch device in recent sessions set
sentryIns.getDeviceList(GroupType.RecentSessions)
// change license to pro
sentryIns.changeLicense(true)
session manager
// check device if online before connecting
sentryIns
  .checkDevice()
  .then(() => {
    console.log('continue')
  })
  .catch((e) => {
    console.warn(e)
  })
// resume connect if need admin auth
sentryIns.resumeConnectPeer('device_id', { adminAccount: 'admin_account', adminPassword: 'passwd' })
// resume connect if key miss match
sentryIns.resumeConnectPeer('device_id', { key: 'key' })

// create session
interface Options {
  minBitrate: number // append x-google-min-bitrate in create offer. Default: 2000
  maxBitrate: number // x-google-max-bitrate. Default: 5000
  startBitrate: number // x-google-start-bitrate. Default: 4000
  orientationLock: boolean // no longer auto-rotate the streaming orientation to fit the container size
  iceTransportPolicy: RTCIceTransportPolicy // 'all': use all candidate, 'relay': only use 'relay' candidate. Default: 'all'
  onRotate: (result: boolean) => void // invoke when every change orientation if auto-rotate enable
  onPhaseChange: (phase: Phase, deltaTime: number) => void // invoke when phase change in Launcher
}
const options: Options = {}
sentryIns.createSession(hostEl, { deviceId: 'device_id', key: 'key' }, options)
feature
import { Protocol, ScaleMode } from 'live-raylink'

// hide peer device wallpaper
sentryIns.hideWallpaper('device_id')

// change video stream codec to 3000kbps/30fps on peer device
sentryIns.changeQuality('device_id', 3000, 30)

// scale screen to scaled mode on peer device
sentryIns.scaleScreen('device_id', ScaleMode.Scaled)

// switch to second monitor on peer device(if exist)
sentryIns.switchMonitor('device_id', 1)
// you can obtain monitor count by listen `monitor_count_changed` event
sentryIns.event.subscribe('monitor_count_changed', (count) => {
  console.log(`current peer device has ${count} monitor`)
})

// execute REBOOT command on peer device
sentryIns.runCommand('device_id', Protocol.RunCommandType.REBOOT)

Error

all error reason can infer of ErrorReason type in package

| Type | Desc | Source | | --------------------------------- | --------------------------- | -------- | | FAILED | | Protocol | | REFUSE | peer refuses connect | Protocol | | KEY_ERROR | key miss match | Protocol | | WAIT_CONFIRM | | Protocol | | NOT_FOUND_DEVICE | | Protocol | | REPEAT_LOGIN | | Protocol | | VERSION_TOO_LOW | | Protocol | | AUTH_FAILURE | | Protocol | | ACCOUNT_LOCKED | | Protocol | | REPEAT_REGISTER_ID | | Protocol | | DISCONNECT | | Protocol | | DEVICE_OFFLINE | | Protocol | | DEVICE_EXIST | | Protocol | | GROUP_EXIST | | Protocol | | GROUP_NOT_FOUND | | Protocol | | UNSUPPORTED_OPERATION | | Protocol | | DEVICE_NOT_ALLOW | | Protocol | | ACCOUNT_EXPIRED | | Protocol | | LEVEL_TOO_LOW | | Protocol | | VERSION_TOO_LOW_NO_FORCE | | Protocol | | DEVICE_REMOTE_CONTROL_ERROR | | Protocol | | CONNECT_NEED_VERIFY_ADMINISTRATOR | need verify administrator | Protocol | | VERIFY_ADMINISTRATOR_FAILED | administrator auth failed | Protocol | | CHANNEL_NOT_ENOUGH | channel not enough | Protocol | | CHECK_MISMATCH | peer device not for WebRTC | Boundary | | NETWORK_CHANGE | local device network change | WebRTC | | HANG_UP | peer hang up | WebRTC |