...
This commit is contained in:
parent
6813a6bdd7
commit
5b86fc7e2b
@ -122,6 +122,7 @@
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
|
||||
android:screenOrientation="sensor"
|
||||
android:hardwareAccelerated="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
|
||||
@ -131,6 +132,7 @@
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:excludeFromRecents="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
@ -141,6 +143,7 @@
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
|
||||
android:screenOrientation="sensor"
|
||||
android:excludeFromRecents="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
|
||||
@ -754,7 +754,7 @@ function extractSubtitleList() {
|
||||
if (subList.length > 0) {
|
||||
sendMessage({
|
||||
type: "SUBTITLE_LIST_RESULT",
|
||||
list: subList
|
||||
subTitles: subList
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ import android.widget.Spinner
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
@ -181,25 +180,33 @@ class CompletedFilesFragment : Fragment() {
|
||||
currentDir = file
|
||||
loadFiles()
|
||||
} else {
|
||||
val intentFlags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
||||
if (extVideos.contains(file.extension.lowercase())) {
|
||||
trackFileAccess(file.name)
|
||||
loadFiles()
|
||||
val intent = Intent(requireContext(), PlayerActivity::class.java).apply {
|
||||
putExtra("VIDEO_PATH", file.absolutePath)
|
||||
// 💡 기존 인스턴스가 있으면 제거하고 새로 시작
|
||||
flags = intentFlags
|
||||
}
|
||||
startActivity(intent)
|
||||
} else if (extImages.contains(file.extension.lowercase())) {
|
||||
val intent = Intent(requireContext(), ImageViewerActivity::class.java).apply {
|
||||
putExtra("IMAGE_PATH", file.absolutePath)
|
||||
// 💡 이미지 뷰어도 동일하게 적용
|
||||
flags = intentFlags
|
||||
}
|
||||
startActivity(intent)
|
||||
} else if (extDocs.contains(file.extension.lowercase())) {
|
||||
val intent = Intent(requireContext(), DocumentViewerActivity::class.java).apply {
|
||||
putExtra("FILE_PATH", file.absolutePath)
|
||||
// 💡 문서 뷰어도 동일하게 적용
|
||||
flags = intentFlags
|
||||
}
|
||||
startActivity(intent)
|
||||
} else {
|
||||
openPrivateFile(requireContext(), file) // 이미지나 문서는 기존처럼
|
||||
openPrivateFile(requireContext(), file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ open class GeckoWeb @JvmOverloads constructor(
|
||||
when (msg.type) {
|
||||
"SUBTITLE_LIST_RESULT" -> {
|
||||
(context as? PlayerActivity)?.let { player ->
|
||||
// PlayerActivity에 리스트 전달
|
||||
Blog.LOGE("msg.subTitles ${msg.subTitles}")
|
||||
player.runOnUiThread {
|
||||
player.showDownSubtitleSelectionDialog(msg.subTitles)
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package bums.lunatic.launcher.player
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.graphics.Color
|
||||
import android.graphics.SurfaceTexture
|
||||
@ -501,14 +502,26 @@ class PlayerActivity : AppCompatActivity(), TextureView.SurfaceTextureListener {
|
||||
}
|
||||
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent) // 새로운 인텐트로 교체
|
||||
|
||||
// 💡 새로운 비디오 경로를 가져와서 재생 엔진 재설정
|
||||
videoPath = intent?.getStringExtra("VIDEO_PATH") ?: ""
|
||||
if (videoPath.isNotEmpty()) {
|
||||
nativePlayer?.stop()
|
||||
prepareEngine()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun showDownSubtitleSelectionDialog(subList: List<Map<String, String>>) {
|
||||
val items = subList.map { "[${it["lang"]}] ${it["title"]}" }.toTypedArray()
|
||||
|
||||
val items = subList.map { item ->
|
||||
" [${item["lang"]}] ${item["title"]} (${item["size"]})"
|
||||
}.toTypedArray()
|
||||
Blog.LOGE("items >> ${items.size}")
|
||||
AlertDialog.Builder(this)
|
||||
.setTitle("자막 선택")
|
||||
.setTitle("자막 선택 (원본 파일명: ${subList[0]["originalFileName"]})")
|
||||
.setItems(items) { _, which ->
|
||||
val selected = subList[which]
|
||||
val detailUrl = selected["downloadUrl"]
|
||||
@ -518,6 +531,7 @@ class PlayerActivity : AppCompatActivity(), TextureView.SurfaceTextureListener {
|
||||
geckoWeb.sendJsonMsg("GO_TO_SUBTITLE_DETAIL", "url" to detailUrl)
|
||||
}
|
||||
}
|
||||
.setNegativeButton("취소", null)
|
||||
.show()
|
||||
}
|
||||
/**
|
||||
@ -548,6 +562,7 @@ class PlayerActivity : AppCompatActivity(), TextureView.SurfaceTextureListener {
|
||||
}
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
geckoWeb.visibility = View.GONE
|
||||
Toast.makeText(this@PlayerActivity, "자막 저장 완료: ${newSubFile.name}", Toast.LENGTH_SHORT).show()
|
||||
|
||||
// 1. 플레이어의 자막 경로 업데이트
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user