mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
ktlint
This commit is contained in:
parent
5c7bfc78a9
commit
ce801b59c7
@ -91,7 +91,7 @@ class BackgroundMode {
|
|||||||
/**
|
/**
|
||||||
* Gets the video data and prepares the [player].
|
* Gets the video data and prepares the [player].
|
||||||
*/
|
*/
|
||||||
fun playOnBackgroundMode(c: Context, videoId: String, seekToPosition : Long) {
|
fun playOnBackgroundMode(c: Context, videoId: String, seekToPosition: Long) {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
val job = launch {
|
val job = launch {
|
||||||
response = RetrofitInstance.api.getStreams(videoId)
|
response = RetrofitInstance.api.getStreams(videoId)
|
||||||
@ -111,7 +111,6 @@ class BackgroundMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a singleton of this class, to not create a new [player] every time.
|
* Creates a singleton of this class, to not create a new [player] every time.
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,9 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
|||||||
when (which) {
|
when (which) {
|
||||||
// This for example will be the "Background mode" option
|
// This for example will be the "Background mode" option
|
||||||
0 -> {
|
0 -> {
|
||||||
BackgroundMode.getInstance().playOnBackgroundMode(requireContext(), videoId, 0)
|
BackgroundMode
|
||||||
|
.getInstance()
|
||||||
|
.playOnBackgroundMode(requireContext(), videoId, 0)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
@ -86,7 +86,8 @@ class SubscriptionAdapter(
|
|||||||
}
|
}
|
||||||
holder.v.setOnLongClickListener {
|
holder.v.setOnLongClickListener {
|
||||||
val videoId = trending.url!!.replace("/watch?v=", "")
|
val videoId = trending.url!!.replace("/watch?v=", "")
|
||||||
VideoOptionsDialog(videoId, holder.v.context).show(childFragmentManager, VideoOptionsDialog.TAG)
|
VideoOptionsDialog(videoId, holder.v.context)
|
||||||
|
.show(childFragmentManager, VideoOptionsDialog.TAG)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,8 @@ class TrendingAdapter(
|
|||||||
}
|
}
|
||||||
holder.v.setOnLongClickListener {
|
holder.v.setOnLongClickListener {
|
||||||
val videoId = trending.url!!.replace("/watch?v=", "")
|
val videoId = trending.url!!.replace("/watch?v=", "")
|
||||||
VideoOptionsDialog(videoId, holder.v.context).show(childFragmentManager, VideoOptionsDialog.TAG)
|
VideoOptionsDialog(videoId, holder.v.context)
|
||||||
|
.show(childFragmentManager, VideoOptionsDialog.TAG)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user