rename licenseExecutor to licenseRequestExecutor

This commit is contained in:
Kai DeLorenzo 2024-11-28 13:53:01 -05:00
parent 09c09f3d64
commit 41a980e826
No known key found for this signature in database
6 changed files with 35 additions and 35 deletions

View file

@ -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 {

View file

@ -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?
}

View file

@ -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<Any>(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") {
_obj.invoke("getLicenseExecutor", arrayOf<Any>())
val result = V8Plugin.catchScriptErrors<Any>(_config, "[${_config.name}] JSAudioUrlWidevineSource", "obj.getLicenseRequestExecutor()") {
_obj.invoke("getLicenseRequestExecutor", arrayOf<Any>())
}
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)"
}
}

View file

@ -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<Any>(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") {
_obj.invoke("getLicenseExecutor", arrayOf<Any>())
val result = V8Plugin.catchScriptErrors<Any>(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseRequestExecutor()") {
_obj.invoke("getLicenseRequestExecutor", arrayOf<Any>())
}
if (result !is V8ValueObject)

View file

@ -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<Any>(_config, "[${_config.name}] JSDashManifestWidevineSource", "obj.getLicenseExecutor()") {
_obj.invoke("getLicenseExecutor", arrayOf<Any>())
val result = V8Plugin.catchScriptErrors<Any>(_config, "[${_config.name}] JSAudioUrlWidevineSource", "obj.getLicenseRequestExecutor()") {
_obj.invoke("getLicenseRequestExecutor", arrayOf<Any>())
}
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)"
}
}

View file

@ -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
}