Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxr1998 authored and nielsvanvelzen committed Sep 3, 2023
1 parent 819ca47 commit 6388e77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/src/main/assets/native/ExternalPlayerPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export class ExternalPlayerPlugin {
async getDeviceProfile() {
return {
Name: 'Android External Player Stub',
MaxStreamingBitrate: 1000000000,
MaxStaticBitrate: 1000000000,
MaxStreamingBitrate: 1_000_000_000,
MaxStaticBitrate: 1_000_000_000,
DirectPlayProfiles: [{Type: 'Video'}, {Type: 'Audio'}],
CodecProfiles: [],
SubtitleProfiles: [{Method: 'Embed'}, {Method: 'Drop'}],
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/org/jellyfin/mobile/bridge/ExternalPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ class ExternalPlayer(
}

private fun notifyEvent(event: String, parameters: String = "") {
val allowedEvents = arrayOf(Constants.EVENT_CANCELED, Constants.EVENT_ENDED, Constants.EVENT_TIME_UPDATE)
if (event in allowedEvents && parameters.isDigitsOnly()) {
if (event in ALLOWED_EVENTS && parameters.isDigitsOnly()) {
webappFunctionChannel.call("window.ExtPlayer.notify$event($parameters)")
}
}
Expand Down Expand Up @@ -302,4 +301,12 @@ class ExternalPlayer(
else -> null
}
}

companion object {
private val ALLOWED_EVENTS = arrayOf(
Constants.EVENT_CANCELED,
Constants.EVENT_ENDED,
Constants.EVENT_TIME_UPDATE,
)
}
}

0 comments on commit 6388e77

Please sign in to comment.