mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #1908 from Bnyro/master
Fix crash on clicking the player share button
This commit is contained in:
commit
aee44d9b58
@ -166,8 +166,6 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
*/
|
*/
|
||||||
private lateinit var nowPlayingNotification: NowPlayingNotification
|
private lateinit var nowPlayingNotification: NowPlayingNotification
|
||||||
|
|
||||||
private lateinit var shareData: ShareData
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
arguments?.let {
|
arguments?.let {
|
||||||
@ -354,12 +352,14 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
|
|
||||||
// share button
|
// share button
|
||||||
binding.relPlayerShare.setOnClickListener {
|
binding.relPlayerShare.setOnClickListener {
|
||||||
shareData.currentPosition = exoPlayer.currentPosition / 1000
|
|
||||||
val shareDialog =
|
val shareDialog =
|
||||||
ShareDialog(
|
ShareDialog(
|
||||||
videoId!!,
|
videoId!!,
|
||||||
ShareObjectType.VIDEO,
|
ShareObjectType.VIDEO,
|
||||||
shareData
|
ShareData(
|
||||||
|
currentVideo = streams.title,
|
||||||
|
currentPosition = exoPlayer.currentPosition
|
||||||
|
)
|
||||||
)
|
)
|
||||||
shareDialog.show(childFragmentManager, ShareDialog::class.java.name)
|
shareDialog.show(childFragmentManager, ShareDialog::class.java.name)
|
||||||
}
|
}
|
||||||
@ -775,7 +775,6 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
titleTextView.text = response.title
|
titleTextView.text = response.title
|
||||||
|
|
||||||
playerTitle.text = response.title
|
playerTitle.text = response.title
|
||||||
shareData = ShareData(currentVideo = response.title)
|
|
||||||
playerDescription.text = response.description
|
playerDescription.text = response.description
|
||||||
|
|
||||||
playerChannelSubCount.text = context?.getString(
|
playerChannelSubCount.text = context?.getString(
|
||||||
|
@ -95,6 +95,7 @@ class MainSettings : BasePreferenceFragment() {
|
|||||||
|
|
||||||
// checking for update: yes -> dialog, no -> snackBar
|
// checking for update: yes -> dialog, no -> snackBar
|
||||||
update?.setOnPreferenceClickListener {
|
update?.setOnPreferenceClickListener {
|
||||||
|
if (BuildConfig.DEBUG) return@setOnPreferenceClickListener true
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
// check for update
|
// check for update
|
||||||
val updateInfo = try {
|
val updateInfo = try {
|
||||||
|
Loading…
Reference in New Issue
Block a user