Skip to content

Commit

Permalink
breaking: removed playback URL from stream (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Oct 11, 2023
1 parent 73632f2 commit 961772d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .changeset/three-wolves-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@livepeer/core': minor
'@livepeer/core-react': minor
'livepeer': minor
'@livepeer/react': minor
'@livepeer/react-native': minor
---

**Breaking:** removed `playbackUrl` from stream responses. Developers should migrate to using `playbackId` to query stream playback URLs.
6 changes: 4 additions & 2 deletions packages/core-react/src/hooks/stream/useStream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ describe('useStream', () => {

await waitFor(() => expect(result.current.isSuccess).toBeTruthy());

expect(result?.current?.data?.playbackUrl).toMatchInlineSnapshot(
'"https://livepeercdn.com/hls/d7aer9qx8act4lfd/index.m3u8"',
expect((result?.current?.data as any)?.['playbackUrl']).toBeUndefined();

expect(result?.current?.data?.playbackId).toMatchInlineSnapshot(
'"d7aer9qx8act4lfd"',
);
});

Expand Down
3 changes: 0 additions & 3 deletions packages/core-web/src/media/browser/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { beforeAll, describe, expect, it } from 'vitest';
import { addMediaMetrics } from './metrics';
import { MockedVideoElement, resetDateNow, setupClient } from '../../../test';

// const playbackUrl =
// 'https://livepeercdn.com/recordings/9b8a9c59-e5c6-4ba8-9f88-e400b0f9153f/index.m3u8';

describe('addMediaMetrics', () => {
beforeAll(() => {
setupClient();
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/providers/studio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ export class StudioLivepeerProvider extends BaseLivepeerProvider {
return {
...studioStream,
multistream: await this._mapToMultistream(studioStream.multistream),
rtmpIngestUrl: this._getRtmpIngestUrl(studioStream.streamKey),
playbackUrl: this._getPlaybackUrl(studioStream.playbackId),
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/providers/studio/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type StudioFfmpegProfile = TranscodingProfile & {
};

export interface StudioStream
extends Omit<Stream, 'rtmpIngestUrl' | 'playbackUrl' | 'multistream'> {
extends Omit<Stream, 'playbackUrl' | 'multistream'> {
profiles: StudioFfmpegProfile[];
/**
* Name of the token used to create this object.
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ export type Stream = {
rtmpIngestUrl: string;
/** ID used to create the playback URLs */
playbackId: string;
/** URL for HLS playback */
playbackUrl: string;
/** ID of the parent stream object. Only present for sessions. */
parentId?: string;
/** Unix timestamp (in milliseconds) at which the stream object was created */
Expand Down

2 comments on commit 961772d

@vercel
Copy link

@vercel vercel bot commented on 961772d Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 961772d Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.