mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30: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 shareData: ShareData
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
arguments?.let {
|
||||
@ -354,12 +352,14 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
||||
|
||||
// share button
|
||||
binding.relPlayerShare.setOnClickListener {
|
||||
shareData.currentPosition = exoPlayer.currentPosition / 1000
|
||||
val shareDialog =
|
||||
ShareDialog(
|
||||
videoId!!,
|
||||
ShareObjectType.VIDEO,
|
||||
shareData
|
||||
ShareData(
|
||||
currentVideo = streams.title,
|
||||
currentPosition = exoPlayer.currentPosition
|
||||
)
|
||||
)
|
||||
shareDialog.show(childFragmentManager, ShareDialog::class.java.name)
|
||||
}
|
||||
@ -775,7 +775,6 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
||||
titleTextView.text = response.title
|
||||
|
||||
playerTitle.text = response.title
|
||||
shareData = ShareData(currentVideo = response.title)
|
||||
playerDescription.text = response.description
|
||||
|
||||
playerChannelSubCount.text = context?.getString(
|
||||
|
@ -95,6 +95,7 @@ class MainSettings : BasePreferenceFragment() {
|
||||
|
||||
// checking for update: yes -> dialog, no -> snackBar
|
||||
update?.setOnPreferenceClickListener {
|
||||
if (BuildConfig.DEBUG) return@setOnPreferenceClickListener true
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
// check for update
|
||||
val updateInfo = try {
|
||||
|
Loading…
Reference in New Issue
Block a user