Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.khunhtetznaing:xgetter:3.0'
}
dependencies {
implementation("com.github.khunhtetznaing:xgetter:3.0")
}
<dependency>
<groupId>com.github.khunhtetznaing</groupId>
<artifactId>xgetter</artifactId>
<version>3.0</version>
</dependency>
libraryDependencies += "com.github.khunhtetznaing" % "xgetter" % "3.0"
:dependencies [[com.github.khunhtetznaing/xgetter "3.0"]]
I change something to comply with Google play policy.
ရုပ်ရှင်နဲ့ Video App ဖန်တီးချင်သူတွေအနေနဲ့
အသုံးဝင်မယ့် Library လေးပါ။
ကြော်ငြာကြည့်စရာမလိုပဲ
တိုက်ရိုက်ဒေါင်းဖို့လင့်ဆွဲထုတ်ပေးနိုင်ပြီး
ရလာတဲ့လင့်ကို တိုက်ရိုက်ဒေါင်းမလား
ကိုယ်ပိုင် Player နဲ့တိုက်ရိုက်ပြမလား
အဆင်ပြေသလိုအသုံးချနိုင်ပါတယ်။
လောလာဆယ်ပါဝင်တဲ့ Site တွေကတော့
တို့ပဲဖြစ်ပါတယ်။
ဒီဆိုဒ်တွေအားလုံးကနေ ကြော်ငြာကြည့်စရာမလိုပဲတိုက်ရိုက်လင့်ထုတ်ပေးမှာပါ။
အခြားအခမဲ့ Video တင်လို့ရတဲ့ Site တွေကိုလည်းထပ်ဖြည့်ပေးသွားပါ့မယ် :)
အဲ့တော့ Video Sharing App အတွက် Host ဝယ်စရာမလိုတော့ဘူးလေနော် ;)
ပထမဦးဆုံး build.gradle(project) ထဲက
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" } //Add this
}}
ပြီးရင် build.gradle(app) ထဲက
dependencies {
implementation 'com.github.KhunHtetzNaing:xGetter:3.0'
}
Android Studio သမားတွေဆိုရင်တော့ Sync Now လုပ်ပေးပါ။
AIDE သမားဆိုရင်တော့ Save ပြီး Download လုပ်ခိုင်းရင်လုပ်ပေးပါ။
မှတ်ချက်။ ။အင်တာနက်ဖွင့်ထားဖို့လိုပါမယ်
If not working download this jar file and put to YourProject/app/libs/
AndroidManifest.xml ထဲမှာ
<application .....
android:usesCleartextTraffic="true">
ထည့်ပေးဖို့လိုပါမယ်။
ပြီးရင်တော့ကိုယ်ခေါ်ချင်တဲ့ Activity ကနေ
LowCostVideo xGetter = new LowCostVideo(this);
xGetter.onFinish(new LowCostVideo.OnTaskCompleted() {
@Override
public void onTaskCompleted(ArrayList<XModel> vidURL, boolean multiple_quality) {
if (multiple_quality){ //This video you can choose qualities
for (XModel model : vidURL){
String url = model.getUrl();
String cookie = model.getCookie(); //If google drive video you need to set cookie for play or download
}
}else {//If single
String url = vidURL.get(0).getUrl();
}
}
@Override
public void onError() {
//Error
}
});
Okhttp3 ကိုအသုံးပြုထားသည့်အတွက်
proguard-rules.pro ထည့်ပေးရန်လိုအပ်ပါသည်။
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform
အသုံးပြုရတာလည်းလွယ်ပါတယ် :)