Skip to content

Commit

Permalink
html games still not able to view
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 committed Dec 10, 2024
1 parent 88701bb commit f15cde9
Show file tree
Hide file tree
Showing 3 changed files with 456 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,30 @@ abstract class BaseContainerFragment : BaseResourceFragment() {
}

fun openResource(items: RealmMyLibrary) {
val matchingItems = mRealm.where(RealmMyLibrary::class.java)
.equalTo("resourceLocalAddress", items.resourceLocalAddress)
.findAll()
val anyOffline = matchingItems.any { it.isResourceOffline() }
if (anyOffline) {
val offlineItem = matchingItems.first { it.isResourceOffline()}
openFileType(offlineItem, "offline")
} else {
if (items.isResourceOffline()) {
openFileType(items, "offline")
} else if (FileUtils.getFileExtension(items.resourceLocalAddress) == "mp4") {
openFileType(items, "online")
} else {
val arrayList = ArrayList<String>()
arrayList.add(Utilities.getUrl(items))
startDownload(arrayList)
profileDbHandler.setResourceOpenCount(items, KEY_RESOURCE_DOWNLOAD)
}
val intent = Intent(context, WebViewActivity::class.java).apply {
putExtra("isLocalFile", true)
putExtra("RESOURCE_ID", "6f7b1d7a7c9c73e736b38657bc013556") // The _id from the library item
}
startActivity(intent)
// val matchingItems = mRealm.where(RealmMyLibrary::class.java)
// .equalTo("resourceLocalAddress", items.resourceLocalAddress)
// .findAll()
// val anyOffline = matchingItems.any { it.isResourceOffline() }
// if (anyOffline) {
// val offlineItem = matchingItems.first { it.isResourceOffline()}
// openFileType(offlineItem, "offline")
// } else {
// if (items.isResourceOffline()) {
// openFileType(items, "offline")
// } else if (FileUtils.getFileExtension(items.resourceLocalAddress) == "mp4") {
// openFileType(items, "online")
// } else {
// val arrayList = ArrayList<String>()
// arrayList.add(Utilities.getUrl(items))
// startDownload(arrayList)
// profileDbHandler.setResourceOpenCount(items, KEY_RESOURCE_DOWNLOAD)
// }
// }
}

private fun checkFileExtension(items: RealmMyLibrary) {
Expand Down
Loading

0 comments on commit f15cde9

Please sign in to comment.