Address review feedback

This commit is contained in:
Maxr1998 authored and Niels van Velzen committed 2023-09-03 09:45:04 +02:00
1 parent 819ca4723a
commit 6388e77fdd
2 files changed
+11 -4

No files matched your search

@@ -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'}],
@@ -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)")
}
}
@@ -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,
)
}
}