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");
}
}
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");
}
}
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());
}
}
Aggregations