mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-04-23 22:57:37 +02:00
Fix duration
This commit is contained in:
parent
3ed94c4e7f
commit
b0d34f0e31
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package app.fedilab.fedilabtube;
|
package app.fedilab.fedilabtube;
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.asynctasks.ManagePlaylistsAsyncTask;
|
import app.fedilab.fedilabtube.asynctasks.ManagePlaylistsAsyncTask;
|
||||||
import app.fedilab.fedilabtube.asynctasks.PostActionAsyncTask;
|
import app.fedilab.fedilabtube.asynctasks.PostActionAsyncTask;
|
||||||
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleAsyncTask;
|
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeSingleAsyncTask;
|
||||||
@ -160,6 +162,7 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
|
|||||||
peertube_bookmark.setVisibility(View.GONE);
|
peertube_bookmark.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||||
instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(PeertubeActivity.this));
|
instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(PeertubeActivity.this));
|
||||||
@ -175,6 +178,8 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
|
|||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mode = sharedpreferences.getInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT);
|
mode = sharedpreferences.getInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT);
|
||||||
if (mode != Helper.VIDEO_MODE_WEBVIEW && mode != Helper.VIDEO_MODE_DIRECT)
|
if (mode != Helper.VIDEO_MODE_WEBVIEW && mode != Helper.VIDEO_MODE_DIRECT)
|
||||||
mode = Helper.VIDEO_MODE_DIRECT;
|
mode = Helper.VIDEO_MODE_DIRECT;
|
||||||
@ -310,10 +315,12 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
|
|||||||
}
|
}
|
||||||
|
|
||||||
peertube = apiResponse.getPeertubes().get(0);
|
peertube = apiResponse.getPeertubes().get(0);
|
||||||
|
//TODO: currently streaming service gives the wrong values for duration
|
||||||
|
peertube.setStreamService(false);
|
||||||
new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST_FOR_VIDEO, null, peertube.getId(), null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST_FOR_VIDEO, null, peertube.getId(), null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
peertube_playlist.setOnClickListener(v -> {
|
peertube_playlist.setOnClickListener(v -> {
|
||||||
if( isLoggedIn(PeertubeActivity.this) ) {
|
if( isLoggedIn(PeertubeActivity.this) ) {
|
||||||
if (playlists != null && peertube.getId() != null) {
|
if (playlists != null && peertube.getId() != null) {
|
||||||
|
@ -75,7 +75,8 @@
|
|||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
android:textColor="#FFBEBEBE"
|
android:textColor="#FFBEBEBE"
|
||||||
android:textSize="12sp" />
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/exo_position"
|
android:id="@id/exo_position"
|
||||||
@ -85,8 +86,8 @@
|
|||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
android:textColor="#FFBEBEBE"
|
android:textColor="#FFBEBEBE"
|
||||||
android:textSize="14sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
/>
|
||||||
|
|
||||||
<com.google.android.exoplayer2.ui.DefaultTimeBar
|
<com.google.android.exoplayer2.ui.DefaultTimeBar
|
||||||
android:id="@id/exo_progress"
|
android:id="@id/exo_progress"
|
||||||
@ -102,8 +103,8 @@
|
|||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
android:textColor="#FFBEBEBE"
|
android:textColor="#FFBEBEBE"
|
||||||
android:textSize="14sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/exo_fullscreen_button"
|
android:id="@+id/exo_fullscreen_button"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user