Search in sources :

Example 1 with ChannelName

use of com.google.cloud.video.livestream.v1.ChannelName in project java-docs-samples by GoogleCloudPlatform.

the class StartChannel method startChannel.

public static void startChannel(String projectId, String location, String channelId) throws InterruptedException, ExecutionException, TimeoutException, IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
        ChannelName name = ChannelName.of(projectId, location, channelId);
        livestreamServiceClient.startChannelAsync(name).get(1, TimeUnit.MINUTES);
        System.out.println("Started channel");
    }
}
Also used : ChannelName(com.google.cloud.video.livestream.v1.ChannelName) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Example 2 with ChannelName

use of com.google.cloud.video.livestream.v1.ChannelName in project java-docs-samples by GoogleCloudPlatform.

the class StopChannel method stopChannel.

public static void stopChannel(String projectId, String location, String channelId) throws InterruptedException, ExecutionException, TimeoutException, IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
        ChannelName name = ChannelName.of(projectId, location, channelId);
        livestreamServiceClient.stopChannelAsync(name).get(1, TimeUnit.MINUTES);
        System.out.println("Stopped channel");
    }
}
Also used : ChannelName(com.google.cloud.video.livestream.v1.ChannelName) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Example 3 with ChannelName

use of com.google.cloud.video.livestream.v1.ChannelName in project java-docs-samples by GoogleCloudPlatform.

the class GetChannel method getChannel.

public static void getChannel(String projectId, String location, String channelId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
        ChannelName name = ChannelName.of(projectId, location, channelId);
        Channel response = livestreamServiceClient.getChannel(name);
        System.out.println("Channel: " + response.getName());
    }
}
Also used : ChannelName(com.google.cloud.video.livestream.v1.ChannelName) Channel(com.google.cloud.video.livestream.v1.Channel) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Aggregations

ChannelName (com.google.cloud.video.livestream.v1.ChannelName)3 LivestreamServiceClient (com.google.cloud.video.livestream.v1.LivestreamServiceClient)3 Channel (com.google.cloud.video.livestream.v1.Channel)1