Here are the examples of the java api class taken from open source projects.

1. YouTubeApi#getLiveEvents()

Project: yt-watchme
Source File:
View license
// TODO: Catch those exceptions and handle them here.
public static List<EventData> getLiveEvents(YouTube youtube) throws IOException {
    Log.i(MainActivity.APP_NAME, "Requesting live events.");
    YouTube.LiveBroadcasts.List liveBroadcastRequest = youtube.liveBroadcasts().list("id,snippet,contentDetails");
    // liveBroadcastRequest.setMine(true);
    // List request is executed and list of broadcasts are returned
    LiveBroadcastListResponse returnedListResponse = liveBroadcastRequest.execute();
    // Get the list of broadcasts associated with the user.
    List<LiveBroadcast> returnedList = returnedListResponse.getItems();
    List<EventData> resultList = new ArrayList<EventData>(returnedList.size());
    EventData event;
    for (LiveBroadcast broadcast : returnedList) {
        event = new EventData();
        String streamId = broadcast.getContentDetails().getBoundStreamId();
        if (streamId != null) {
            String ingestionAddress = getIngestionAddress(youtube, streamId);
    return resultList;