跳转到主要内容
GET
/
session
/
{id}
TypeScript
import { Livepeer } from "livepeer";

const livepeer = new Livepeer({
  apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await livepeer.session.get("<id>");

  // Handle the result
  console.log(result);
}

run();
{
  "name": "test_session",
  "id": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
  "kind": "stream",
  "userId": "66E2161C-7670-4D05-B71D-DA2D6979556F",
  "lastSeen": 1587667174725,
  "sourceSegments": 1,
  "transcodedSegments": 2,
  "sourceSegmentsDuration": 1,
  "transcodedSegmentsDuration": 2,
  "sourceBytes": 1,
  "transcodedBytes": 2,
  "ingestRate": 1,
  "outgoingRate": 2,
  "isHealthy": "<unknown>",
  "issues": "<unknown>",
  "createdAt": 1587667174725,
  "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
  "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
  "record": false,
  "recordingStatus": "waiting",
  "recordingUrl": "<string>",
  "mp4Url": "<string>",
  "playbackId": "eaw4nk06ts2d0mzb",
  "profiles": "<unknown>",
  "recordingSpec": "<unknown>"
}

获取会话

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

路径参数

id
string
必填

ID of the session

响应

Success

name
string
必填
示例:

"test_session"

id
string
示例:

"de7818e7-610a-4057-8f6f-b785dc1e6f88"

kind
string
已弃用
示例:

"stream"

userId
string
已弃用
示例:

"66E2161C-7670-4D05-B71D-DA2D6979556F"

lastSeen
number
示例:

1587667174725

sourceSegments
number
示例:

1

transcodedSegments
number
示例:

2

sourceSegmentsDuration
number

Duration of all the source segments, sec

示例:

1

transcodedSegmentsDuration
number

Duration of all the transcoded segments, sec

示例:

2

sourceBytes
number
示例:

1

transcodedBytes
number
示例:

2

ingestRate
number

Rate at which sourceBytes increases (bytes/second)

示例:

1

outgoingRate
number

Rate at which transcodedBytes increases (bytes/second)

示例:

2

isHealthy
any
issues
any
createdAt
number

Timestamp (in milliseconds) at which stream object was created

示例:

1587667174725

parentId
string

Points to parent stream object

示例:

"de7818e7-610a-4057-8f6f-b785dc1e6f88"

projectId
string

The ID of the project

示例:

"aac12556-4d65-4d34-9fb6-d1f0985eb0a9"

record
boolean

Whether the stream should be recorded. Uses default settings. For more customization, create and configure an object store.

示例:

false

recordingStatus
enum<string>

The status of the recording process of this stream session.

可用选项:
waiting,
ready,
failed,
deleted,
none
recordingUrl
string

URL for accessing the recording of this stream session.

mp4Url
string

The URL for the stream session recording packaged in an MP4.

playbackId
string

The playback ID to use with the Playback Info endpoint to retrieve playback URLs.

示例:

"eaw4nk06ts2d0mzb"

profiles
any
recordingSpec
any
Last modified on March 1, 2026