Merge pull request #1908 from Bnyro/master

Fix crash on clicking the player share button
This commit is contained in:
Bnyro 2022-11-19 10:04:33 +01:00 committed by GitHub
commit aee44d9b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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(

View File

@ -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 {