Skip to content

Latest commit

 

History

History
570 lines (404 loc) · 18.8 KB

README.md

File metadata and controls

570 lines (404 loc) · 18.8 KB

Room

(room())

Overview

Operations related to rooms api

Available Operations

  • create - Create a room ⚠️ Deprecated
  • get - Retrieve a room ⚠️ Deprecated
  • delete - Delete a room ⚠️ Deprecated
  • startEgress - Start room RTMP egress ⚠️ Deprecated
  • stopEgress - Stop room RTMP egress ⚠️ Deprecated
  • createUser - Create a room user ⚠️ Deprecated
  • getUser - Get user details ⚠️ Deprecated
  • updateUser - Update a room user ⚠️ Deprecated
  • deleteUser - Remove a user from the room ⚠️ Deprecated

create

Create a multiparticipant livestreaming room.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.CreateRoomResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            CreateRoomResponse res = sdk.room().create()
                .call();

            if (res.createRoomResponse().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Response

CreateRoomResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

get

Retrieve a room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetRoomResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetRoomResponse res = sdk.room().get()
                .id("<value>")
                .call();

            if (res.room().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A

Response

GetRoomResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

delete

Delete a room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.DeleteRoomResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            DeleteRoomResponse res = sdk.room().delete()
                .id("<value>")
                .call();

            // handle response
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A

Response

DeleteRoomResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

startEgress

Create a livestream for your room. This allows you to leverage livestreaming features like recording and HLS output.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.components.RoomEgressPayload;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.StartRoomEgressResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            StartRoomEgressResponse res = sdk.room().startEgress()
                .id("<value>")
                .roomEgressPayload(RoomEgressPayload.builder()
                    .streamId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9")
                    .build())
                .call();

            // handle response
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A
roomEgressPayload RoomEgressPayload ✔️ N/A

Response

StartRoomEgressResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

stopEgress

Stop room RTMP egress

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.StopRoomEgressResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            StopRoomEgressResponse res = sdk.room().stopEgress()
                .id("<value>")
                .call();

            // handle response
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A

Response

StopRoomEgressResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

createUser

Call this endpoint to add a user to a room, specifying a display name at a minimum. The response will contain a joining URL for Livepeer's default meeting app. Alternatively the joining token can be used with a custom app.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.components.RoomUserPayload;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.CreateRoomUserResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            CreateRoomUserResponse res = sdk.room().createUser()
                .id("<value>")
                .roomUserPayload(RoomUserPayload.builder()
                    .name("name")
                    .canPublish(true)
                    .canPublishData(true)
                    .build())
                .call();

            if (res.roomUserResponse().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A
roomUserPayload RoomUserPayload ✔️ N/A

Response

CreateRoomUserResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

getUser

Get user details

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetRoomUserResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetRoomUserResponse res = sdk.room().getUser()
                .id("<value>")
                .userId("<value>")
                .call();

            if (res.getRoomUserResponse().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A
userId String ✔️ N/A

Response

GetRoomUserResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

updateUser

Update properties for a user.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.components.RoomUserUpdatePayload;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.UpdateRoomUserResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            UpdateRoomUserResponse res = sdk.room().updateUser()
                .id("<value>")
                .userId("<value>")
                .roomUserUpdatePayload(RoomUserUpdatePayload.builder()
                    .canPublish(true)
                    .canPublishData(true)
                    .build())
                .call();

            // handle response
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A
userId String ✔️ N/A
roomUserUpdatePayload RoomUserUpdatePayload ✔️ N/A

Response

UpdateRoomUserResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

deleteUser

Remove a user from the room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.DeleteRoomUserResponse;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            DeleteRoomUserResponse res = sdk.room().deleteUser()
                .id("<value>")
                .userId("<value>")
                .call();

            // handle response
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A
userId String ✔️ N/A

Response

DeleteRoomUserResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*