From cbeb024d0665e40319029463b102dcdf33919291 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 | 6 ++--
examples/view/src/main/res/values/strings.xml | 4 +--
.../src/main/res/xml/root_preferences.xml | 4 +--
.../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, 39 insertions(+), 39 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..b3f392b 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,8 +25,8 @@ 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)
+ private val mediaId: String
+ get() = sharedPref.getString(getString(R.string.media_id_key), null)
?: throw IllegalArgumentException("Video ID is not set")
private val videoType: VideoType
get() {
@@ -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..33dd741 100644
--- a/examples/view/src/main/res/values/strings.xml
+++ b/examples/view/src/main/res/values/strings.xml
@@ -4,8 +4,8 @@
vi77Dgk0F8eLwaFOtC5870yn
- video_id_key
- VideoId
+ 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..84420a6 100644
--- a/examples/view/src/main/res/xml/root_preferences.xml
+++ b/examples/view/src/main/res/xml/root_preferences.xml
@@ -3,8 +3,8 @@