From 567b883cde14983699ce2fe3cfa9a18ab3e49ced Mon Sep 17 00:00:00 2001 From: ThibaultBee <37510686+ThibaultBee@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:35:27 +0100 Subject: [PATCH] refactor(player): rename videoId to mediaId --- .../video/api/player/example/MainActivity.kt | 8 ++--- examples/view/src/main/res/values/strings.xml | 6 ++-- .../src/main/res/xml/root_preferences.xml | 6 ++-- .../models/ApiVideoExoPlayerMediaFactory.kt | 2 +- .../video/api/player/models/VideoOptions.kt | 32 +++++++++---------- .../main/java/video/api/player/utils/Utils.kt | 6 ++-- .../api/player/models/VideoOptionsTest.kt | 24 +++++++------- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/examples/view/src/main/java/video/api/player/example/MainActivity.kt b/examples/view/src/main/java/video/api/player/example/MainActivity.kt index cbc10e6..04964e0 100644 --- a/examples/view/src/main/java/video/api/player/example/MainActivity.kt +++ b/examples/view/src/main/java/video/api/player/example/MainActivity.kt @@ -25,9 +25,9 @@ class MainActivity : AppCompatActivity() { private val sharedPref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(this) } - private val videoId: String - get() = sharedPref.getString(getString(R.string.video_id_key), null) - ?: throw IllegalArgumentException("Video ID is not set") + private val mediaId: String + get() = sharedPref.getString(getString(R.string.media_id_key), null) + ?: throw IllegalArgumentException("MediaID is not set") private val videoType: VideoType get() { val videoType = @@ -190,7 +190,7 @@ class MainActivity : AppCompatActivity() { private fun loadVideo() { try { - playerController.videoOptions = VideoOptions(videoId, videoType, privateVideoToken) + playerController.videoOptions = VideoOptions(mediaId, videoType, privateVideoToken) } catch (e: Exception) { Log.e(TAG, "Error while loading video", e) displayMessage("Error while loading video: ${e.message}") diff --git a/examples/view/src/main/res/values/strings.xml b/examples/view/src/main/res/values/strings.xml index 1fe8809..c302d07 100644 --- a/examples/view/src/main/res/values/strings.xml +++ b/examples/view/src/main/res/values/strings.xml @@ -3,9 +3,9 @@ Settings - vi77Dgk0F8eLwaFOtC5870yn - video_id_key - VideoId + vi77Dgk0F8eLwaFOtC5870yn + media_id_key + MediaId video_type_key VOD Live diff --git a/examples/view/src/main/res/xml/root_preferences.xml b/examples/view/src/main/res/xml/root_preferences.xml index b663804..2cb87e8 100644 --- a/examples/view/src/main/res/xml/root_preferences.xml +++ b/examples/view/src/main/res/xml/root_preferences.xml @@ -2,9 +2,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto">