Merge pull request #1588 from Bnyro/master

fix the share behavior
This commit is contained in:
Bnyro 2022-10-18 17:20:59 +02:00 committed by GitHub
commit 3744a326f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -74,13 +74,13 @@ class RouterActivity : BaseActivity() {
val videoId = uri.getQueryParameter("v") val videoId = uri.getQueryParameter("v")
intent.putExtra(IntentData.videoId, videoId) intent.putExtra(IntentData.videoId, videoId)
uri.getQueryParameter("t")?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
} }
else -> { else -> {
val timeStamp = uri.getQueryParameter("t")
val videoId = uri.path!!.replace("/", "") val videoId = uri.path!!.replace("/", "")
intent.putExtra(IntentData.videoId, videoId) intent.putExtra(IntentData.videoId, videoId)
if (timeStamp != null) intent.putExtra(IntentData.timeStamp, timeStamp.toLong()) uri.getQueryParameter("t")?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
} }
} }
return intent return intent

View File

@ -55,7 +55,7 @@ class ShareDialog(
} }
var url = "$host$path" var url = "$host$path"
if (shareObjectType == ShareObjectType.VIDEO && binding!!.timeCodeSwitch.isChecked) { if (shareObjectType == ShareObjectType.VIDEO && position != null && binding!!.timeCodeSwitch.isChecked) {
url += "&t=${binding!!.timeStamp.text}" url += "&t=${binding!!.timeStamp.text}"
} }