├── app ├── .gitignore ├── libs │ └── YouTubeAndroidPlayerApi.jar ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_av_upload.png │ │ │ ├── ic_content_picture.png │ │ │ ├── ic_device_access_video.png │ │ │ └── ic_stat_device_access_video.png │ │ ├── drawable-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_av_upload.png │ │ │ ├── ic_menu_refresh.png │ │ │ ├── ic_content_picture.png │ │ │ ├── ic_mailboxes_accounts.png │ │ │ ├── ic_device_access_video.png │ │ │ └── ic_stat_device_access_video.png │ │ ├── drawable-xhdpi │ │ │ ├── ic_av_upload.png │ │ │ ├── ic_launcher.png │ │ │ ├── ic_menu_refresh.png │ │ │ ├── ic_content_picture.png │ │ │ ├── ic_device_access_video.png │ │ │ ├── list_divider_holo_dark.png │ │ │ └── ic_stat_device_access_video.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_av_upload.png │ │ │ ├── ic_content_picture.png │ │ │ ├── ic_device_access_video.png │ │ │ └── ic_stat_device_access_video.png │ │ ├── menu │ │ │ ├── play.xml │ │ │ ├── review.xml │ │ │ └── activity_main.xml │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── layout │ │ │ ├── developer_setup_required.xml │ │ │ ├── activity_play.xml │ │ │ ├── activity_review.xml │ │ │ ├── list_item.xml │ │ │ ├── activity_main.xml │ │ │ └── list_fragment.xml │ │ └── drawable │ │ │ └── list_divider_horizontal_inset.xml │ │ ├── java │ │ └── com │ │ │ └── google │ │ │ └── ytdl │ │ │ ├── Auth.java │ │ │ ├── Constants.java │ │ │ ├── util │ │ │ ├── Upload.java │ │ │ ├── VideoData.java │ │ │ ├── LruBitmapCache.java │ │ │ ├── NetworkSingleton.java │ │ │ └── Utils.java │ │ │ ├── ReviewActivity.java │ │ │ ├── PlayActivity.java │ │ │ ├── UploadService.java │ │ │ ├── UploadsListFragment.java │ │ │ ├── ResumableUpload.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro ├── build.gradle └── app.iml ├── settings.gradle ├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── scopes │ └── scope_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .classpath ├── gradle.properties ├── yt-direct-lite-android.iml ├── README.md ├── gradlew.bat ├── CONTRIBUTING.md ├── gradlew └── LICENSE-2.0.txt /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | app.iml -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | YouTube Direct Lite for Android -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .DS_Store 3 | YouTubeDirectLiteforAndroid.iml 4 | .idea 5 | build 6 | local.properties -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/libs/YouTubeAndroidPlayerApi.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/libs/YouTubeAndroidPlayerApi.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_av_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-hdpi/ic_av_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_av_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_av_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_av_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_av_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_menu_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_menu_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_av_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_av_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-hdpi/ic_content_picture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_content_picture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_mailboxes_accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_mailboxes_accounts.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_content_picture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_content_picture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-hdpi/ic_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/list_divider_holo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/list_divider_holo_dark.png -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_stat_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-hdpi/ic_stat_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_stat_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-mdpi/ic_stat_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_stat_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xhdpi/ic_stat_device_access_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_stat_device_access_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youtube/yt-direct-lite-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_stat_device_access_video.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Aug 20 10:24:27 EDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/menu/play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/review.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 80dp 5 | 48dp 6 | 200dp 7 | 8dp 8 | 16dp 9 | 16dp 10 | 16dp 11 | 12 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/ulukaya/android-sdks/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /app/src/main/res/layout/developer_setup_required.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/list_divider_horizontal_inset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 23 | -------------------------------------------------------------------------------- /yt-direct-lite-android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/ytdl/Auth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.ytdl; 16 | 17 | import com.google.android.gms.common.Scopes; 18 | import com.google.api.services.youtube.YouTubeScopes; 19 | 20 | public class Auth { 21 | // Register an API key here: https://console.developers.google.com 22 | public static final String KEY = "Replace me with your API key"; 23 | 24 | public static final String[] SCOPES = {Scopes.PROFILE, YouTubeScopes.YOUTUBE}; 25 | } 26 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.google.ytdl" 9 | minSdkVersion 16 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile 'com.google.android.gms:play-services-plus:7.8.0' 25 | compile 'com.android.support:support-v13:23.0.0' 26 | compile 'com.google.apis:google-api-services-youtube:v3-rev120-1.19.0' 27 | compile 'com.google.http-client:google-http-client-android:+' 28 | compile 'com.google.api-client:google-api-client-android:+' 29 | compile 'com.google.api-client:google-api-client-gson:+' 30 | compile 'com.google.code.gson:gson:2.2.4' 31 | compile 'com.mcxiaoke.volley:library:1.0.18' 32 | compile files('libs/YouTubeAndroidPlayerApi.jar') 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/ytdl/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.ytdl; 16 | 17 | /** 18 | * @author Ibrahim Ulukaya 19 | *

20 | * This class hold constants. 21 | */ 22 | public class Constants { 23 | public static final int MAX_KEYWORD_LENGTH = 30; 24 | public static final String DEFAULT_KEYWORD = "ytdl"; 25 | // A playlist ID is a string that begins with PL. You must replace this string with the correct 26 | // playlist ID for the app to work 27 | public static final String UPLOAD_PLAYLIST = "Replace me with the playlist ID you want to upload into"; 28 | public static final String APP_NAME = "ytd-android"; 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/ytdl/util/Upload.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.ytdl.util; 16 | 17 | import com.google.ytdl.Constants; 18 | 19 | public class Upload { 20 | public static String generateKeywordFromPlaylistId(String playlistId) { 21 | if (playlistId == null) playlistId = ""; 22 | if (playlistId.indexOf("PL") == 0) { 23 | playlistId = playlistId.substring(2); 24 | } 25 | playlistId = playlistId.replaceAll("\\W", ""); 26 | String keyword = Constants.DEFAULT_KEYWORD.concat(playlistId); 27 | if (keyword.length() > Constants.MAX_KEYWORD_LENGTH) { 28 | keyword = keyword.substring(0, Constants.MAX_KEYWORD_LENGTH); 29 | } 30 | return keyword; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YouTube Direct Lite for Android 2 | =========== 3 | 4 | The code is a reference implementation for an Android OS application that captures video, uploads it to YouTube, and submits the video to a [YouTube Direct Lite](http://code.google.com/p/youtube-direct-lite/) instance. 5 | 6 | For more information, you can read the [Youtube API blog post](http://apiblog.youtube.com/2013/08/heres-my-playlist-so-submit-video-maybe.html). 7 | 8 | This application utilizes [YouTube Data API v3](https://developers.google.com/youtube/v3/) , [YouTube Android Player API](https://developers.google.com/youtube/android/player/), [YouTube Resumable Uploads](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol?hl=en), [Google Play Services](https://developer.android.com/google/play-services/index.html) and [Plus API](https://developers.google.com/+/mobile/android/Google). 9 | 10 | To use this application, 11 | 12 | 1. In your [Google Developers Console](https://console.developers.google.com), 13 | 1. Enable the YouTube Data API v3 and Google+ API. 14 | 1. Create a client ID for Android, using your SHA1 and package name. 15 | 1. [Register your Android app](https://developers.google.com/youtube/android/player/register) 16 | 1. Plug in your Playlist Id into Constants.java and Android API Key into Auth.java 17 | 18 | ![alt tag](https://ytd-android.googlecode.com/files/YTDL.png) 19 | 20 | ![alt tag](https://ytd-android.googlecode.com/files/YTDL-review.png) 21 | 22 | ![alt tag](https://ytd-android.googlecode.com/files/YTDL-upload.png) 23 | 24 | ![alt tag](https://ytd-android.googlecode.com/files/YTDL-watch.png) 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 39 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_play.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 23 | 24 | 25 | 29 | 30 |