diff --git a/app/src/main/assets/scripts/source.js b/app/src/main/assets/scripts/source.js index e8df05a1..402d4aa0 100644 --- a/app/src/main/assets/scripts/source.js +++ b/app/src/main/assets/scripts/source.js @@ -373,8 +373,8 @@ class VideoUrlWidevineSource extends VideoUrlSource { this.plugin_type = "VideoUrlWidevineSource"; this.licenseUri = obj.licenseUri; - if(obj.getLicenseExecutor) - this.getLicenseExecutor = obj.getLicenseExecutor; + if(obj.getLicenseRequestExecutor) + this.getLicenseRequestExecutor = obj.getLicenseRequestExecutor; } } class VideoUrlRangeSource extends VideoUrlSource { @@ -410,12 +410,12 @@ class AudioUrlWidevineSource extends AudioUrlSource { this.plugin_type = "AudioUrlWidevineSource"; this.licenseUri = obj.licenseUri; - if(obj.getLicenseExecutor) - this.getLicenseExecutor = obj.getLicenseExecutor; + if(obj.getLicenseRequestExecutor) + this.getLicenseRequestExecutor = obj.getLicenseRequestExecutor; // deprecated api conversion if(obj.bearerToken) { - this.getLicenseExecutor = () => { + this.getLicenseRequestExecutor = () => { return { executeRequest: (url, _headers, _method, license_request_data) => { return http.POST( @@ -477,8 +477,8 @@ class DashWidevineSource extends DashSource { this.plugin_type = "DashWidevineSource"; this.licenseUri = obj.licenseUri; - if(obj.getLicenseExecutor) - this.getLicenseExecutor = obj.getLicenseExecutor; + if(obj.getLicenseRequestExecutor) + this.getLicenseRequestExecutor = obj.getLicenseRequestExecutor; } } class DashManifestRawSource { diff --git a/app/src/main/java/com/futo/platformplayer/api/media/models/streams/sources/IWidevineSource.kt b/app/src/main/java/com/futo/platformplayer/api/media/models/streams/sources/IWidevineSource.kt index 111fdd18..b94cf12c 100644 --- a/app/src/main/java/com/futo/platformplayer/api/media/models/streams/sources/IWidevineSource.kt +++ b/app/src/main/java/com/futo/platformplayer/api/media/models/streams/sources/IWidevineSource.kt @@ -4,6 +4,6 @@ import com.futo.platformplayer.api.media.platforms.js.models.JSRequestExecutor interface IWidevineSource { val licenseUri: String - val hasLicenseExecutor: Boolean - fun getLicenseExecutor(): JSRequestExecutor? + val hasLicenseRequestExecutor: Boolean + fun getLicenseRequestExecutor(): JSRequestExecutor? } \ No newline at end of file diff --git a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSAudioUrlWidevineSource.kt b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSAudioUrlWidevineSource.kt index 9ae014ca..516e07ff 100644 --- a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSAudioUrlWidevineSource.kt +++ b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSAudioUrlWidevineSource.kt @@ -9,7 +9,7 @@ import com.futo.platformplayer.getOrThrow class JSAudioUrlWidevineSource : JSAudioUrlSource, IAudioUrlWidevineSource { override val licenseUri: String - override val hasLicenseExecutor: Boolean + override val hasLicenseRequestExecutor: Boolean @Suppress("ConvertSecondaryConstructorToPrimary") constructor(plugin: JSClient, obj: V8ValueObject) : super(plugin, obj) { @@ -17,15 +17,15 @@ class JSAudioUrlWidevineSource : JSAudioUrlSource, IAudioUrlWidevineSource { val config = plugin.config licenseUri = _obj.getOrThrow(config, "licenseUri", contextName) - hasLicenseExecutor = obj.has("getLicenseExecutor") + hasLicenseRequestExecutor = obj.has("getLicenseRequestExecutor") } - override fun getLicenseExecutor(): JSRequestExecutor? { - if (!hasLicenseExecutor || _obj.isClosed) + override fun getLicenseRequestExecutor(): JSRequestExecutor? { + if (!hasLicenseRequestExecutor || _obj.isClosed) return null - val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") { - _obj.invoke("getLicenseExecutor", arrayOf()) + val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSAudioUrlWidevineSource", "obj.getLicenseRequestExecutor()") { + _obj.invoke("getLicenseRequestExecutor", arrayOf()) } if (result !is V8ValueObject) @@ -36,6 +36,6 @@ class JSAudioUrlWidevineSource : JSAudioUrlSource, IAudioUrlWidevineSource { override fun toString(): String { val url = getAudioUrl() - return "(name=$name, container=$container, bitrate=$bitrate, codec=$codec, url=$url, language=$language, duration=$duration, hasLicenseExecutor=${hasLicenseExecutor}, licenseUri=$licenseUri)" + return "(name=$name, container=$container, bitrate=$bitrate, codec=$codec, url=$url, language=$language, duration=$duration, hasLicenseRequestExecutor=${hasLicenseRequestExecutor}, licenseUri=$licenseUri)" } } diff --git a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSDashManifestWidevineSource.kt b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSDashManifestWidevineSource.kt index f039978e..be72d3a0 100644 --- a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSDashManifestWidevineSource.kt +++ b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSDashManifestWidevineSource.kt @@ -24,7 +24,7 @@ class JSDashManifestWidevineSource : IVideoUrlSource, IDashManifestSource, override var priority: Boolean = false override val licenseUri: String - override val hasLicenseExecutor: Boolean + override val hasLicenseRequestExecutor: Boolean @Suppress("ConvertSecondaryConstructorToPrimary") constructor(plugin: JSClient, obj: V8ValueObject) : super(TYPE_DASH, plugin, obj) { @@ -37,15 +37,15 @@ class JSDashManifestWidevineSource : IVideoUrlSource, IDashManifestSource, priority = obj.getOrNull(config, "priority", contextName) ?: false licenseUri = _obj.getOrThrow(config, "licenseUri", contextName) - hasLicenseExecutor = obj.has("getLicenseExecutor") + hasLicenseRequestExecutor = obj.has("getLicenseRequestExecutor") } - override fun getLicenseExecutor(): JSRequestExecutor? { - if (!hasLicenseExecutor || _obj.isClosed) + override fun getLicenseRequestExecutor(): JSRequestExecutor? { + if (!hasLicenseRequestExecutor || _obj.isClosed) return null - val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") { - _obj.invoke("getLicenseExecutor", arrayOf()) + val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseRequestExecutor()") { + _obj.invoke("getLicenseRequestExecutor", arrayOf()) } if (result !is V8ValueObject) diff --git a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSVideoUrlWidevineSource.kt b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSVideoUrlWidevineSource.kt index 7c3e0e64..bcd6607d 100644 --- a/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSVideoUrlWidevineSource.kt +++ b/app/src/main/java/com/futo/platformplayer/api/media/platforms/js/models/sources/JSVideoUrlWidevineSource.kt @@ -9,7 +9,7 @@ import com.futo.platformplayer.getOrThrow class JSVideoUrlWidevineSource : JSVideoUrlSource, IVideoUrlWidevineSource { override val licenseUri: String - override val hasLicenseExecutor: Boolean + override val hasLicenseRequestExecutor: Boolean @Suppress("ConvertSecondaryConstructorToPrimary") constructor(plugin: JSClient, obj: V8ValueObject) : super(plugin, obj) { @@ -17,15 +17,15 @@ class JSVideoUrlWidevineSource : JSVideoUrlSource, IVideoUrlWidevineSource { val config = plugin.config licenseUri = _obj.getOrThrow(config, "licenseUri", contextName) - hasLicenseExecutor = obj.has("getLicenseExecutor") + hasLicenseRequestExecutor = obj.has("getLicenseRequestExecutor") } - override fun getLicenseExecutor(): JSRequestExecutor? { - if (!hasLicenseExecutor || _obj.isClosed) + override fun getLicenseRequestExecutor(): JSRequestExecutor? { + if (!hasLicenseRequestExecutor || _obj.isClosed) return null - val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") { - _obj.invoke("getLicenseExecutor", arrayOf()) + val result = V8Plugin.catchScriptErrors(_config, "[${_config.name}] JSAudioUrlWidevineSource", "obj.getLicenseRequestExecutor()") { + _obj.invoke("getLicenseRequestExecutor", arrayOf()) } if (result !is V8ValueObject) @@ -36,6 +36,6 @@ class JSVideoUrlWidevineSource : JSVideoUrlSource, IVideoUrlWidevineSource { override fun toString(): String { val url = getVideoUrl() - return "(width=$width, height=$height, container=$container, codec=$codec, name=$name, bitrate=$bitrate, duration=$duration, url=$url, hasLicenseExecutor=$hasLicenseExecutor, licenseUri=$licenseUri)" + return "(width=$width, height=$height, container=$container, codec=$codec, name=$name, bitrate=$bitrate, duration=$duration, url=$url, hasLicenseRequestExecutor=$hasLicenseRequestExecutor, licenseUri=$licenseUri)" } } \ No newline at end of file diff --git a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt index c4d94b7d..9ca559ca 100644 --- a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt +++ b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt @@ -490,8 +490,8 @@ abstract class FutoVideoPlayerBase : RelativeLayout { val baseCallback = HttpMediaDrmCallback(videoSource.licenseUri, dataSource) - val callback = if (videoSource.hasLicenseExecutor) { - PluginMediaDrmCallback(baseCallback, videoSource.getLicenseExecutor()!!, videoSource.licenseUri) + val callback = if (videoSource.hasLicenseRequestExecutor) { + PluginMediaDrmCallback(baseCallback, videoSource.getLicenseRequestExecutor()!!, videoSource.licenseUri) } else { baseCallback } @@ -525,8 +525,8 @@ abstract class FutoVideoPlayerBase : RelativeLayout { val baseCallback = HttpMediaDrmCallback(videoSource.licenseUri, dataSource) - val callback = if (videoSource.hasLicenseExecutor) { - PluginMediaDrmCallback(baseCallback, videoSource.getLicenseExecutor()!!, videoSource.licenseUri) + val callback = if (videoSource.hasLicenseRequestExecutor) { + PluginMediaDrmCallback(baseCallback, videoSource.getLicenseRequestExecutor()!!, videoSource.licenseUri) } else { baseCallback } @@ -692,8 +692,8 @@ abstract class FutoVideoPlayerBase : RelativeLayout { val baseCallback = HttpMediaDrmCallback(audioSource.licenseUri, dataSource) - val callback = if (audioSource.hasLicenseExecutor) { - PluginMediaDrmCallback(baseCallback, audioSource.getLicenseExecutor()!!, audioSource.licenseUri) + val callback = if (audioSource.hasLicenseRequestExecutor) { + PluginMediaDrmCallback(baseCallback, audioSource.getLicenseRequestExecutor()!!, audioSource.licenseUri) } else { baseCallback }