Compare commits
1 commit
master
...
dep-update
Author | SHA1 | Date | |
---|---|---|---|
|
2d50a30d46 |
9 changed files with 69 additions and 73 deletions
1
.github/workflows/deploy.yml
vendored
1
.github/workflows/deploy.yml
vendored
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -28,8 +28,6 @@ twitterConsumerKey=XXXXXX
|
||||||
twitterConsumerSecret=XXXXXX
|
twitterConsumerSecret=XXXXXX
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy the file 'google-services.sample.json' to 'google-services.json' in the app/ folder.
|
|
||||||
|
|
||||||
Click the Sync button and when process finishes, the Run button to launch the app on your simulator or connected debugging device after the build process is complete.
|
Click the Sync button and when process finishes, the Run button to launch the app on your simulator or connected debugging device after the build process is complete.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
|
@ -3,8 +3,7 @@ import com.google.gms.googleservices.GoogleServicesPlugin
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 33
|
||||||
buildToolsVersion "29.0.2"
|
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
@ -14,18 +13,19 @@ android {
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "io.lbry.browser"
|
applicationId "io.lbry.browser"
|
||||||
minSdkVersion 21
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 33
|
||||||
versionCode 1701
|
versionCode 1702
|
||||||
versionName "0.17.1"
|
versionName "0.17.2"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
exclude 'META-INF/DEPENDENCIES'
|
resources {
|
||||||
exclude 'lib/x86_64/darwin/libscrypt.dylib'
|
excludes += ['META-INF/DEPENDENCIES', 'lib/x86_64/darwin/libscrypt.dylib']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
__32bit {
|
__32bit {
|
||||||
versionCode android.defaultConfig.versionCode * 10 + 1
|
versionCode android.defaultConfig.versionCode * 10 + 1
|
||||||
|
@ -57,6 +57,7 @@ android {
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
namespace 'io.lbry.browser'
|
||||||
}
|
}
|
||||||
|
|
||||||
task printVersionName {
|
task printVersionName {
|
||||||
|
@ -75,48 +76,49 @@ configurations {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
|
implementation 'androidx.appcompat:appcompat:1.7.0-alpha01'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha01'
|
implementation 'com.google.android.material:material:1.8.0-alpha02'
|
||||||
implementation "androidx.cardview:cardview:1.0.0"
|
implementation "androidx.cardview:cardview:1.0.0"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
implementation 'androidx.navigation:navigation-fragment:2.3.1'
|
implementation 'androidx.navigation:navigation-fragment:2.5.3'
|
||||||
implementation 'androidx.navigation:navigation-ui:2.3.1'
|
implementation 'androidx.navigation:navigation-ui:2.5.3'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
||||||
implementation 'androidx.preference:preference:1.1.1'
|
implementation 'androidx.preference:preference:1.2.0'
|
||||||
implementation 'androidx.webkit:webkit:1.4.0-rc01'
|
implementation 'androidx.webkit:webkit:1.6.0-alpha03'
|
||||||
implementation 'androidx.camera:camera-core:1.0.0-beta03'
|
implementation 'androidx.camera:camera-core:1.3.0-alpha01'
|
||||||
implementation 'androidx.camera:camera-camera2:1.0.0-beta03'
|
implementation 'androidx.camera:camera-camera2:1.3.0-alpha01'
|
||||||
implementation 'androidx.camera:camera-lifecycle:1.0.0-beta03'
|
implementation 'androidx.camera:camera-lifecycle:1.3.0-alpha01'
|
||||||
implementation 'androidx.camera:camera-view:1.0.0-alpha10'
|
implementation 'androidx.camera:camera-view:1.3.0-alpha01'
|
||||||
implementation 'androidx.browser:browser:1.2.0'
|
implementation 'androidx.browser:browser:1.4.0'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
|
|
||||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
implementation 'com.google.firebase:firebase-analytics:18.0.0'
|
implementation 'com.google.firebase:firebase-iid:21.1.0'
|
||||||
implementation 'com.google.android.gms:play-services-base:17.5.0'
|
implementation 'com.google.firebase:firebase-analytics:21.2.0'
|
||||||
implementation 'com.google.firebase:firebase-messaging:21.0.0'
|
implementation 'com.google.android.gms:play-services-base:18.1.0'
|
||||||
|
implementation 'com.google.firebase:firebase-messaging:23.1.0'
|
||||||
implementation 'com.google.oauth-client:google-oauth-client:1.30.4'
|
implementation 'com.google.oauth-client:google-oauth-client:1.30.4'
|
||||||
|
|
||||||
implementation 'com.android.billingclient:billing:3.0.2'
|
implementation 'com.android.billingclient:billing:5.1.0'
|
||||||
|
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.12.2'
|
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.1'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer-dash:2.12.2'
|
implementation 'com.google.android.exoplayer:exoplayer-dash:2.18.1'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.12.2'
|
implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.1'
|
||||||
implementation 'com.google.android.exoplayer:extension-cast:2.12.2'
|
implementation 'com.google.android.exoplayer:extension-cast:2.18.1'
|
||||||
implementation 'com.google.android.exoplayer:extension-mediasession:2.12.2'
|
implementation 'com.google.android.exoplayer:extension-mediasession:2.18.1'
|
||||||
|
|
||||||
implementation 'com.google.android:flexbox:2.0.1'
|
implementation 'com.google.android.flexbox:flexbox:3.0.0'
|
||||||
|
|
||||||
implementation 'com.hbb20:ccp:2.3.8'
|
implementation 'com.hbb20:ccp:2.5.1'
|
||||||
|
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||||
implementation 'com.atlassian.commonmark:commonmark:0.14.0'
|
implementation 'com.atlassian.commonmark:commonmark:0.14.0'
|
||||||
|
|
||||||
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1.LTS'
|
implementation 'com.arthenica:mobile-ffmpeg-full:4.4.LTS'
|
||||||
|
|
||||||
implementation 'commons-codec:commons-codec:1.15'
|
implementation 'commons-codec:commons-codec:1.15'
|
||||||
implementation 'org.bitcoinj:bitcoinj-tools:0.14.7'
|
implementation 'org.bitcoinj:bitcoinj-tools:0.14.7'
|
||||||
|
@ -127,13 +129,14 @@ dependencies {
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.10'
|
compileOnly 'org.projectlombok:lombok:1.18.10'
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.10'
|
annotationProcessor 'org.projectlombok:lombok:1.18.10'
|
||||||
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.10")
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test:runner:1.3.0'
|
androidTestImplementation 'androidx.test:runner:1.5.1'
|
||||||
androidTestImplementation 'androidx.test:rules:1.3.0'
|
androidTestImplementation 'androidx.test:rules:1.5.0'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
|
||||||
|
|
||||||
__32bitImplementation 'io.lbry:lbrysdk32:0.102.0'
|
__32bitImplementation 'io.lbry:lbrysdk32:0.102.0'
|
||||||
__64bitImplementation 'io.lbry:lbrysdk64:0.102.0'
|
__64bitImplementation 'io.lbry:lbrysdk64:0.102.0'
|
||||||
|
@ -141,4 +144,3 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
GoogleServicesPlugin.config.disableVersionCheck = true
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="io.lbry.browser"
|
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
||||||
|
|
||||||
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
|
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:exported="true"
|
||||||
android:supportsPictureInPicture="true"
|
android:supportsPictureInPicture="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
|
|
|
@ -53,7 +53,8 @@ import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.github.chrisbanes.photoview.PhotoView;
|
import com.github.chrisbanes.photoview.PhotoView;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.DefaultControlDispatcher;
|
//import com.google.android.exoplayer2.DefaultControlDispatcher;
|
||||||
|
import com.google.android.exoplayer2.ForwardingPlayer;
|
||||||
import com.google.android.exoplayer2.ParserException;
|
import com.google.android.exoplayer2.ParserException;
|
||||||
import com.google.android.exoplayer2.PlaybackParameters;
|
import com.google.android.exoplayer2.PlaybackParameters;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
|
@ -65,10 +66,11 @@ import com.google.android.exoplayer2.source.MediaSource;
|
||||||
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||||
import com.google.android.exoplayer2.ui.PlayerControlView;
|
import com.google.android.exoplayer2.ui.PlayerControlView;
|
||||||
import com.google.android.exoplayer2.ui.PlayerView;
|
import com.google.android.exoplayer2.ui.PlayerView;
|
||||||
|
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
|
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
|
||||||
import com.google.android.exoplayer2.upstream.Loader;
|
import com.google.android.exoplayer2.upstream.Loader;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
|
//import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
||||||
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
@ -200,7 +202,8 @@ public class FileViewFragment extends BaseFragment implements
|
||||||
private ClaimListAdapter relatedContentAdapter;
|
private ClaimListAdapter relatedContentAdapter;
|
||||||
private CommentListAdapter commentListAdapter;
|
private CommentListAdapter commentListAdapter;
|
||||||
private BroadcastReceiver sdkReceiver;
|
private BroadcastReceiver sdkReceiver;
|
||||||
private Player.EventListener fileViewPlayerListener;
|
//private Player.EventListener fileViewPlayerListener;
|
||||||
|
private Player.Listener fileViewPlayerListener;
|
||||||
|
|
||||||
private long elapsedDuration = 0;
|
private long elapsedDuration = 0;
|
||||||
private long totalDuration = 0;
|
private long totalDuration = 0;
|
||||||
|
@ -296,7 +299,7 @@ public class FileViewFragment extends BaseFragment implements
|
||||||
|
|
||||||
initUi(root);
|
initUi(root);
|
||||||
|
|
||||||
fileViewPlayerListener = new Player.EventListener() {
|
fileViewPlayerListener = new Player.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPlaybackStateChanged(@Player.State int playbackState) {
|
public void onPlaybackStateChanged(@Player.State int playbackState) {
|
||||||
if (playbackState == Player.STATE_READY) {
|
if (playbackState == Player.STATE_READY) {
|
||||||
|
@ -1208,18 +1211,19 @@ public class FileViewFragment extends BaseFragment implements
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
|
StyledPlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
|
||||||
View playbackSpeedContainer = playerView.findViewById(R.id.player_playback_speed);
|
View playbackSpeedContainer = playerView.findViewById(R.id.player_playback_speed);
|
||||||
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
|
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
|
||||||
textPlaybackSpeed.setText(DEFAULT_PLAYBACK_SPEED);
|
textPlaybackSpeed.setText(DEFAULT_PLAYBACK_SPEED);
|
||||||
|
|
||||||
|
/* TODO: Removed until better method is rewritten
|
||||||
playerView.setControlDispatcher(new DefaultControlDispatcher() {
|
playerView.setControlDispatcher(new DefaultControlDispatcher() {
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchSetPlayWhenReady(Player player, boolean playWhenReady) {
|
public boolean dispatchSetPlayWhenReady(Player player, boolean playWhenReady) {
|
||||||
isPlaying = playWhenReady;
|
isPlaying = playWhenReady;
|
||||||
return super.dispatchSetPlayWhenReady(player, playWhenReady);
|
return super.dispatchSetPlayWhenReady(player, playWhenReady);
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
playbackSpeedContainer.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
|
playbackSpeedContainer.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1772,7 +1776,7 @@ public class FileViewFragment extends BaseFragment implements
|
||||||
if (MainActivity.appPlayer == null && context != null) {
|
if (MainActivity.appPlayer == null && context != null) {
|
||||||
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
||||||
.setUsage(C.USAGE_MEDIA)
|
.setUsage(C.USAGE_MEDIA)
|
||||||
.setContentType(C.CONTENT_TYPE_MOVIE)
|
.setContentType(C.AUDIO_CONTENT_TYPE_MOVIE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
|
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
|
||||||
|
@ -3040,14 +3044,6 @@ public class FileViewFragment extends BaseFragment implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StreamLoadErrorPolicy extends DefaultLoadErrorHandlingPolicy {
|
public static class StreamLoadErrorPolicy extends DefaultLoadErrorHandlingPolicy {
|
||||||
@Override
|
|
||||||
public long getRetryDelayMsFor(int dataType, long loadDurationMs, IOException exception, int errorCount) {
|
|
||||||
return exception instanceof ParserException
|
|
||||||
|| exception instanceof FileNotFoundException
|
|
||||||
|| exception instanceof Loader.UnexpectedLoaderException
|
|
||||||
? C.TIME_UNSET
|
|
||||||
: Math.min((errorCount - 1) * 1000, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinimumLoadableRetryCount(int dataType) {
|
public int getMinimumLoadableRetryCount(int dataType) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer;
|
import com.google.android.exoplayer2.SimpleExoPlayer;
|
||||||
import com.google.android.exoplayer2.audio.AudioAttributes;
|
import com.google.android.exoplayer2.audio.AudioAttributes;
|
||||||
|
@ -29,8 +30,10 @@ import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
|
||||||
import com.google.android.exoplayer2.source.MediaSource;
|
import com.google.android.exoplayer2.source.MediaSource;
|
||||||
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||||
import com.google.android.exoplayer2.ui.PlayerView;
|
import com.google.android.exoplayer2.ui.PlayerView;
|
||||||
|
import com.google.android.exoplayer2.upstream.DefaultDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource.Factory;
|
||||||
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
||||||
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
@ -88,7 +91,7 @@ public class ShuffleFragment extends BaseFragment {
|
||||||
private boolean isPlaying;
|
private boolean isPlaying;
|
||||||
private boolean newPlayerCreated;
|
private boolean newPlayerCreated;
|
||||||
private String currentUrl;
|
private String currentUrl;
|
||||||
private Player.EventListener playerListener;
|
private Player.Listener playerListener;
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
ViewGroup container, Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -97,7 +100,7 @@ public class ShuffleFragment extends BaseFragment {
|
||||||
surfModeLoading = root.findViewById(R.id.shuffle_loading);
|
surfModeLoading = root.findViewById(R.id.shuffle_loading);
|
||||||
textTitle = root.findViewById(R.id.shuffle_content_title);
|
textTitle = root.findViewById(R.id.shuffle_content_title);
|
||||||
textPublisher = root.findViewById(R.id.shuffle_content_publisher);
|
textPublisher = root.findViewById(R.id.shuffle_content_publisher);
|
||||||
playerListener = new Player.EventListener() {
|
playerListener = new Player.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
|
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
|
||||||
if (playbackState == Player.STATE_READY) {
|
if (playbackState == Player.STATE_READY) {
|
||||||
|
@ -445,7 +448,7 @@ public class ShuffleFragment extends BaseFragment {
|
||||||
if (MainActivity.appPlayer == null && context != null) {
|
if (MainActivity.appPlayer == null && context != null) {
|
||||||
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
||||||
.setUsage(C.USAGE_MEDIA)
|
.setUsage(C.USAGE_MEDIA)
|
||||||
.setContentType(C.CONTENT_TYPE_MOVIE)
|
.setContentType(C.AUDIO_CONTENT_TYPE_MOVIE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
|
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
|
||||||
|
@ -498,9 +501,9 @@ public class ShuffleFragment extends BaseFragment {
|
||||||
String userAgent = Util.getUserAgent(context, getString(R.string.app_name));
|
String userAgent = Util.getUserAgent(context, getString(R.string.app_name));
|
||||||
String mediaSourceUrl = getStreamingUrl();
|
String mediaSourceUrl = getStreamingUrl();
|
||||||
MediaSource mediaSource = new ProgressiveMediaSource.Factory(
|
MediaSource mediaSource = new ProgressiveMediaSource.Factory(
|
||||||
new CacheDataSourceFactory(MainActivity.playerCache, new DefaultDataSourceFactory(context, userAgent)),
|
new CacheDataSource.Factory().setCache(MainActivity.playerCache).setUpstreamDataSourceFactory( new DefaultDataSource.Factory(context)),
|
||||||
new DefaultExtractorsFactory()
|
new DefaultExtractorsFactory()
|
||||||
).setLoadErrorHandlingPolicy(new FileViewFragment.StreamLoadErrorPolicy()).createMediaSource(Uri.parse(mediaSourceUrl));
|
).setLoadErrorHandlingPolicy(new FileViewFragment.StreamLoadErrorPolicy()).createMediaSource(MediaItem.fromUri(Uri.parse(mediaSourceUrl)));
|
||||||
|
|
||||||
MainActivity.appPlayer.prepare(mediaSource, true, true);
|
MainActivity.appPlayer.prepare(mediaSource, true, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public final class Lbry {
|
||||||
|
|
||||||
public static final int TTL_CLAIM_SEARCH_VALUE = 120000; // 2-minute TTL for cache
|
public static final int TTL_CLAIM_SEARCH_VALUE = 120000; // 2-minute TTL for cache
|
||||||
public static final String SDK_CONNECTION_STRING = "http://127.0.0.1:5279";
|
public static final String SDK_CONNECTION_STRING = "http://127.0.0.1:5279";
|
||||||
public static final String LBRY_TV_CONNECTION_STRING = "https://api.na-backend.odysee.com/api/v1/proxy";
|
public static final String LBRY_TV_CONNECTION_STRING = "https://api.lbry.tv/api/v1/proxy";
|
||||||
public static final String TAG = "Lbry";
|
public static final String TAG = "Lbry";
|
||||||
|
|
||||||
// Values to obtain from LBRY SDK status
|
// Values to obtain from LBRY SDK status
|
||||||
|
|
|
@ -4,12 +4,11 @@ buildscript {
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.4'
|
classpath 'com.android.tools.build:gradle:7.3.1'
|
||||||
classpath 'com.google.gms:google-services:4.2.0'
|
classpath 'com.google.gms:google-services:4.3.14'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
@ -19,7 +18,6 @@ buildscript {
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
/*flatDir {
|
/*flatDir {
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||||
|
|
Loading…
Reference in a new issue