mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
fix live videos not playing
This commit is contained in:
parent
63cf758fe8
commit
d48e8f5fb9
@ -720,12 +720,18 @@ class PlayerFragment : Fragment() {
|
|||||||
setMediaSource(subtitle, videoUri, audioUrl)
|
setMediaSource(subtitle, videoUri, audioUrl)
|
||||||
qualityText.text = videosNameArray[index]
|
qualityText.text = videosNameArray[index]
|
||||||
return@lit
|
return@lit
|
||||||
} else if (index + 1 == response.videoStreams.size) {
|
} else if (response.hls != null) {
|
||||||
val mediaItem: MediaItem = MediaItem.Builder()
|
val mediaItem: MediaItem = MediaItem.Builder()
|
||||||
.setUri(response.hls)
|
.setUri(response.hls)
|
||||||
.setSubtitleConfigurations(subtitle)
|
.setSubtitleConfigurations(subtitle)
|
||||||
.build()
|
.build()
|
||||||
exoPlayer.setMediaItem(mediaItem)
|
exoPlayer.setMediaItem(mediaItem)
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
getString(R.string.unknown_error),
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -967,7 +973,6 @@ class PlayerFragment : Fragment() {
|
|||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
Log.e(TAG, "HttpException, unexpected response")
|
Log.e(TAG, "HttpException, unexpected response")
|
||||||
Toast.makeText(context, R.string.server_error, Toast.LENGTH_SHORT).show()
|
|
||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
}
|
}
|
||||||
commentsAdapter = CommentsAdapter(videoId!!, commentsResponse.comments)
|
commentsAdapter = CommentsAdapter(videoId!!, commentsResponse.comments)
|
||||||
|
52
app/src/main/res/layout-land/activity_main.xml
Normal file
52
app/src/main/res/layout-land/activity_main.xml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layoutDescription="@xml/activity_main_scene"
|
||||||
|
tools:context=".MainActivity"
|
||||||
|
android:id="@+id/mainMotionLayout">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
app:menu="@menu/action_bar"
|
||||||
|
app:titleCentered="true"
|
||||||
|
app:subtitleCentered="true"
|
||||||
|
app:title="@string/app_name"
|
||||||
|
app:navigationIcon="@drawable/ic_settings"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.google.android.material.navigationrail.NavigationRailView
|
||||||
|
android:id="@+id/railNav"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/toolbar"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:menu="@menu/bottom_menu" />
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/fragment"
|
||||||
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/railNav"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/toolbar"
|
||||||
|
app:navGraph="@navigation/nav" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:elevation="20dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:background="@android:color/transparent" />
|
||||||
|
</androidx.constraintlayout.motion.widget.MotionLayout>
|
Loading…
x
Reference in New Issue
Block a user