├── LICENSE ├── README-DRM.md ├── README.md └── VBPlayerDemo ├── .gitignore ├── PlayerDemo ├── build.gradle ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── viblast │ │ └── android │ │ └── vbplayerdemo │ │ └── MainActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── layout │ └── activity_main.xml │ ├── values-v11 │ └── styles.xml │ ├── values-v14 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── VBPlayerDemo.iml ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt ├── settings.gradle └── viblast-2.19-release ├── build.gradle ├── viblast-2.19-release.aar └── viblast-2.19-release.iml /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2008-2015 Viblast LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-DRM.md: -------------------------------------------------------------------------------- 1 | # Drm Protection 2 | 3 | Viblast Android SDK supports `PlayReady`, `Widevine`, `ClearKey` or Multi-DRM protected DASH streams. 4 | 5 | 6 | ## How it works 7 | To enable `DRM` support, the Application must provide `ViblastDrmCallback` object when the player is created. If the object is `null`, the Viblast Player can not handle `DRM` protected streams. 8 | 9 | When the playback of protected stream starts: 10 | 1. The Renderer detects the available `CDM` pssh boxes. 11 | 2. Then internally notifies the player that the stream is protected with a list of applied `CDMs`. 12 | 3. Viblast Player selects device supported `CDMs` from the list and invokes `onDrmInfoNeed` of the `ViblastDrmCallback` object. 13 | 4. The Application chooses the desired CDM and returns it with the `ViblastDRMInfo` object as a result of the callback. 14 | 5. Viblast Player uses the result object `ViblastDrmInfo` in order to initialize the `CDM` and to provision the key acquisition requests. 15 | 6. If the result is `null` then the player will inform the Renderer that the `DRM` is not supported and the playback will not continue. 16 | 17 | ## Viblast DRM API 18 | 19 | `com.viblast.android.drm` 20 | ### Interface `ViblastDrmCallback` 21 | Implementation of this interface is passed to the ViblastPlayer, allowing it to interact with the calling application to retrieve `CDM` specific data. 22 | #### Method summary 23 | ``` 24 | ViblastDRMInfo onDrmInfoNeed(Set cdmUUIDs); 25 | ``` 26 | - Returns a ViblastDRMInfo object containing the desired `CDM` initialization data. Might be `null` if the application can not handle any of the passed `CDMs`. 27 | - parameter cdmUUIDs - a set of `CDM` UUIDs supported by the device and applicable for the protected stream. 28 | 29 | ### Class ViblastDRMInfo 30 | Provides the information needed for initialization and operation of the desired `CDM`. 31 | #### Method summary 32 | ``` 33 | ViblastDrmInfo(UUID selectedCdmUUID, String licenseServerUrl) 34 | throws IllegalArgumentException; 35 | ``` 36 | - Creates an object with the given `CDM` UUID and the DRM license server `url`. 37 | - throws IllegalArgumentException if the selectedCdmUUID is null 38 | 39 | ``` 40 | String getLicenseServerUrl(); 41 | ``` 42 | - Returns the license server `url` 43 | 44 | ``` 45 | String getSelectedCdmUUID(); 46 | ``` 47 | - Returns the `CDM` UUID 48 | 49 | ``` 50 | void addDrmKeyRequestProperty(String key, String value); 51 | ``` 52 | - Adds key request property. The key will be added as a header to the http requests performed by the underlying security module. 53 | 54 | ``` 55 | void removeDrmKeyRequestProperty(String key); 56 | ``` 57 | - Removes a key request property. 58 | 59 | ``` 60 | void removeAllDrmKeyRequestProperties(String key); 61 | ``` 62 | - Removes all keys request properties. 63 | 64 | ``` 65 | String getDrmKeyRequestProperty(String key); 66 | ``` 67 | - Returns the value of the given key. Might be null. 68 | 69 | ``` 70 | Map getAllDrmKeyRequestProperties(); 71 | ``` 72 | - Returns all added keys. 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Overview 2 | 3 | Viblast PDN Android SDK extends your peer-assisted video delivery to the part of your audience using Android devices. Viblast PDN allows you to stream to web and mobile audiences up to 70% more efficiently. 4 | 5 | Visit Viblast PDN's [web page](http://viblast.com/pdn/) 6 | 7 | ### Project setup 8 | Let's assume you have an existing Android Studio project or you've just created one. 9 | 10 | - Download the aar `viblast--release.aar` file 11 | - In Android studio: New > New Module > Import JAR/AAR Package 12 | - In Android studio: Select your module > Right Click > Open Module Settings (F4) > Dependencies > + > Module Dependency > viblast--release 13 | - Add dependency for ExoPlayer in `build.gradle`: 14 | ``` 15 | dependencies { 16 | compile 'com.google.android.exoplayer:exoplayer:2.6.0' 17 | } 18 | ``` 19 | 20 | ### Basic usage example 21 | 22 | Viblast requires Internet access in order to work, so make sure you have 23 | requested the appropriate permissions in your `AndroidManifest.xml` file 24 | 25 | ```xml 26 | 27 | ... 28 | 29 | ... 30 | 31 | ``` 32 | 33 | Create a `ViblastView` inside your layout 34 | 35 | ```xml 36 | ... 37 | 42 | ... 43 | ``` 44 | 45 | Naturally, you can specify the parameters most suitable for your 46 | application's interface. The code above is just an example. 47 | 48 | The only thing you need is a ViblastPlayer instance. A good spot to 49 | create it is in the Activity's onCreate method. 50 | 51 | ```java 52 | public class MainActivity extends Activity { 53 | ... // as usual 54 | private ViblastPlayer viblastPlayer; 55 | private ViblastView viblastView; 56 | 57 | @Override 58 | protected void onCreate(Bundle savedInstanceState) { 59 | super.onCreate(savedInstanceState); 60 | ... // as usual 61 | 62 | viblastView = (ViblastView)findViewById(R.id.viblast_view); 63 | 64 | final ViblastConfig vbConfig = new ViblastConfig(); 65 | vbConfig.setCdnStream("your-cdn-stream"); 66 | vbConfig.advancedConfig.put("enable-pdn", "true"); 67 | vbConfig.advancedConfig.put("enable-realtime-loggger", "true"); 68 | vbConfig.advancedConfig.put("realtime-logger-server", "wss://cs.viblast.com/rt"); 69 | vbConfig.advancedConfig.put("key", "200057d28abdc9fb593eb654629f2f03c14fac9c5fc0825c899bd6095ad7a8de79ad770b4e99ec1581285ecb2cac1d6d"); 70 | 71 | viblastPlayer = new ViblastPlayer(viblastView, vbConfig); 72 | } 73 | ``` 74 | 75 | Start Viblast on Activity start 76 | 77 | ```java 78 | @Override 79 | protected void onStart() { 80 | super.onStart(); 81 | viblastPlayer.start(); 82 | } 83 | ``` 84 | 85 | Don't forget to stop and release Viblast when the Activity stops 86 | 87 | ```java 88 | @Override 89 | protected void onStop() { 90 | viblastPlayer.release(); 91 | super.onStop(); 92 | } 93 | ``` 94 | 95 | That's about it. Your video playback through Viblast should begin after 96 | you start your Activity. 97 | 98 | ### Licensing 99 | 100 | To remove the Viblast logo you should get a license key and set it in ```vbConfig```: 101 | ```java 102 | vbConfig.advancedConfig.put("key", "YOURKEY"); 103 | ``` 104 | 105 | ### Checking playback state 106 | There are five playback states: 107 | - IDLE 108 | - ```The player is neither prepared or being prepared.``` 109 | - BUFFERING 110 | - ```The player is prepared but not able to immediately play from the current position. 111 | This state typically occurs when more data needs to be buffered for playback to start.``` 112 | - PLAYING 113 | - ```The player is playing.``` 114 | - ENDED 115 | - ```The player has finished playing the media.``` 116 | 117 | There are two options for checking playback state: 118 | * check current playback state 119 | * Simply call ```viblastPlayer.getPlaybackState()```: 120 | ```java 121 | viblastPlayer = new ViblastPlayer(viblastView, vbConfig); 122 | playbackState = viblastPlayer.getPlaybackState(); 123 | ``` 124 | 125 | * listen for playback state changes 126 | * Add listener to ```viblastPlayer```: 127 | ```java 128 | viblastPlayer = new ViblastPlayer(viblastView, vbConfig); 129 | viblastPlayer.addListener(new Listener() { 130 | @Override 131 | public void onPlaybackStateChanged(ViblastPlayerState state) { 132 | // state contains new playback state 133 | } 134 | // ... 135 | }); 136 | ``` 137 | 138 | ### ExoPlayer 139 | 140 | The current version of Viblast is built on top of ExoPlayer version *2.6.0*. It must be specified in `build.gradle`: 141 | ``` 142 | dependencies { 143 | compile 'com.google.android.exoplayer:exoplayer:2.6.0' 144 | } 145 | ``` 146 | -------------------------------------------------------------------------------- /VBPlayerDemo/.gitignore: -------------------------------------------------------------------------------- 1 | java_library/build/ 2 | build/ 3 | PlayerDemo/build/ 4 | .gradle/ 5 | .idea/ 6 | PlayerDemo/.externalNativeBuild/ 7 | PlayerDemo/PlayerDemo.iml 8 | local.properties 9 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "28.0.3" 6 | 7 | defaultConfig { 8 | applicationId "com.viblast.android.vbplayerdemo" 9 | minSdkVersion 19 10 | targetSdkVersion 26 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | api 'com.google.android.exoplayer:exoplayer:2.6.0' 23 | implementation project(':viblast-2.19-release') 24 | } 25 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/java/com/viblast/android/vbplayerdemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.viblast.android.vbplayerdemo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.viblast.android.ViblastConfig; 7 | import com.viblast.android.ViblastPlayer; 8 | import com.viblast.android.ViblastView; 9 | 10 | public class MainActivity extends Activity { 11 | private ViblastPlayer viblastPlayer; 12 | private ViblastView viblastView; 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | viblastView = (ViblastView)findViewById(R.id.viblast_view); 19 | 20 | final ViblastConfig vbConfig = new ViblastConfig(); 21 | 22 | // start faster, using the lowest resolution: 23 | vbConfig.advancedConfig.put("initial-abr-index", "0"); 24 | 25 | vbConfig.setCdnStream("https://cdn3.viblast.com/streams/hls/airshow/playlist.m3u8"); 26 | vbConfig.advancedConfig.put("log", "error"); 27 | 28 | vbConfig.advancedConfig.put("enable-pdn", "false"); 29 | vbConfig.advancedConfig.put("enable-realtime-loggger", "false"); 30 | vbConfig.advancedConfig.put("key", "200057d28abdc9fb593eb654629f2f03c14fac9c5fc0825c899bd6095ad7a8deb99804cd93c2896bb19efc36e0d4af34dbdba0de07b6909d7d0dbe314ec6bdfc"); 31 | // if you want to see Viblast logs: 32 | // vbConfig.advancedConfig.put("log", "verbose"); 33 | 34 | viblastPlayer = new ViblastPlayer(viblastView, vbConfig); 35 | } 36 | 37 | @Override 38 | protected void onStart() { 39 | super.onStart(); 40 | 41 | viblastPlayer.start(); 42 | } 43 | 44 | 45 | 46 | @Override 47 | protected void onStop() { 48 | viblastPlayer.release(); 49 | 50 | super.onStop(); 51 | } 52 | 53 | @Override 54 | protected void onDestroy() { 55 | viblastPlayer.release(); 56 | super.onDestroy(); 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viblast/android-pdn-sdk/fc47697488f525cde549878f96da1accfdcef29a/VBPlayerDemo/PlayerDemo/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viblast/android-pdn-sdk/fc47697488f525cde549878f96da1accfdcef29a/VBPlayerDemo/PlayerDemo/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viblast/android-pdn-sdk/fc47697488f525cde549878f96da1accfdcef29a/VBPlayerDemo/PlayerDemo/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ViblastSampleApp 5 | 6 | 7 | -------------------------------------------------------------------------------- /VBPlayerDemo/PlayerDemo/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /VBPlayerDemo/VBPlayerDemo.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /VBPlayerDemo/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /VBPlayerDemo/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viblast/android-pdn-sdk/fc47697488f525cde549878f96da1accfdcef29a/VBPlayerDemo/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /VBPlayerDemo/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 01 13:19:05 EET 2019 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-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /VBPlayerDemo/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /VBPlayerDemo/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /VBPlayerDemo/import-summary.txt: -------------------------------------------------------------------------------- 1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY 2 | ====================================== 3 | 4 | Ignored Files: 5 | -------------- 6 | The following files were *not* copied into the new Gradle project; you 7 | should evaluate whether these are still needed in your project and if 8 | so manually move them: 9 | 10 | * .gitignore 11 | * proguard-project.txt 12 | 13 | Moved Files: 14 | ------------ 15 | Android Gradle projects use a different directory structure than ADT 16 | Eclipse projects. Here's how the projects were restructured: 17 | 18 | * AndroidManifest.xml => app/src/main/AndroidManifest.xml 19 | * libs/armeabi/libnative-viblast-jni.so => app/src/main/jniLibs/armeabi/libnative-viblast-jni.so 20 | * libs/armeabi/libviblast.so => app/src/main/jniLibs/armeabi/libviblast.so 21 | * libs/exoplayerlib.jar => app/libs/exoplayerlib.jar 22 | * libs/viblast.jar => app/libs/viblast.jar 23 | * libs/x86/libnative-viblast-jni.so => app/src/main/jniLibs/x86/libnative-viblast-jni.so 24 | * libs/x86/libviblast.so => app/src/main/jniLibs/x86/libviblast.so 25 | * lint.xml => app/lint.xml 26 | * res/ => app/src/main/res/ 27 | * src/ => app/src/main/java/ 28 | 29 | Next Steps: 30 | ----------- 31 | You can now build the project. The Gradle project needs network 32 | connectivity to download dependencies. 33 | 34 | Bugs: 35 | ----- 36 | If for some reason your project does not build, and you determine that 37 | it is due to a bug or limitation of the Eclipse to Gradle importer, 38 | please file a bug at http://b.android.com with category 39 | Component-Tools. 40 | 41 | (This import summary is for your information only, and can be deleted 42 | after import once you are satisfied with the results.) 43 | -------------------------------------------------------------------------------- /VBPlayerDemo/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':PlayerDemo', ':viblast-2.19-release' 2 | -------------------------------------------------------------------------------- /VBPlayerDemo/viblast-2.19-release/build.gradle: -------------------------------------------------------------------------------- 1 | configurations.maybeCreate("default") 2 | artifacts.add("default", file('viblast-2.19-release.aar')) -------------------------------------------------------------------------------- /VBPlayerDemo/viblast-2.19-release/viblast-2.19-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viblast/android-pdn-sdk/fc47697488f525cde549878f96da1accfdcef29a/VBPlayerDemo/viblast-2.19-release/viblast-2.19-release.aar -------------------------------------------------------------------------------- /VBPlayerDemo/viblast-2.19-release/viblast-2.19-release.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | --------------------------------------------------------------------------------