From 283eedf5372db4d7068086cb1066795ea2fb1b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Fri, 23 Feb 2024 14:38:57 +0100 Subject: [PATCH 1/4] Use https url --- .../main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt index 87b51616e..95791b66f 100644 --- a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt @@ -444,7 +444,7 @@ data class Playlist(val title: String, val items: List, val descriptio ), DemoItem( title = "Couleur 3 en direct", - uri = "http://stream.srg-ssr.ch/m/couleur3/mp3_128", + uri = "https://stream.srg-ssr.ch/m/couleur3/mp3_128", description = "Audio livestream (unbuffered)", imageUrl = "https://img.rts.ch/articles/2017/image/cxsqgp-25867841.image?w=320&h=320" ) From 941890402219abcf440b9ea5a9f8293d13b354d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Fri, 23 Feb 2024 15:59:59 +0100 Subject: [PATCH 2/4] Display DataSourceException instead of no internet error --- .../pillarbox/core/business/SRGErrorMessageProvider.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/SRGErrorMessageProvider.kt b/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/SRGErrorMessageProvider.kt index e28ac1c8c..5a0efe247 100644 --- a/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/SRGErrorMessageProvider.kt +++ b/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/SRGErrorMessageProvider.kt @@ -8,6 +8,7 @@ import android.content.Context import android.util.Pair import androidx.media3.common.ErrorMessageProvider import androidx.media3.common.PlaybackException +import androidx.media3.datasource.DataSourceException import ch.srgssr.pillarbox.core.business.exception.BlockReasonException import ch.srgssr.pillarbox.core.business.exception.DataParsingException import ch.srgssr.pillarbox.core.business.exception.ResourceNotFoundException @@ -37,6 +38,10 @@ class SRGErrorMessageProvider(private val context: Context) : ErrorMessageProvid Pair.create(0, cause.message) } + is DataSourceException -> { + Pair.create(cause.reason, cause.message) + } + is IOException -> { Pair.create(0, context.getString(R.string.NoInternet)) } From 2960f662ed8632d05b7aa310a00ea684ae82a0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Fri, 23 Feb 2024 16:46:15 +0100 Subject: [PATCH 3/4] Replace not playable url on every device --- .../java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt | 4 ++-- .../java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt | 8 ++++---- .../ch/srgssr/pillarbox/player/MediaItemSourceTest.kt | 3 ++- .../java/ch/srgssr/pillarbox/player/utils/ContentUrls.kt | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt index e2f841d30..7816db6fb 100644 --- a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt @@ -74,8 +74,8 @@ data class DemoItem( val OnDemandVideoMP4 = DemoItem( title = "VOD - MP4", - description = "The dig", - uri = "https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4" + description = "urn:swi:video:48498670", + uri = "https://cdn.prod.swi-services.ch/video-projects/94f5f5d1-5d53-4336-afda-9198462c45d9/localised-videos/ENG/renditions/ENG.mp4" ) val OnDemandVideoUHD = DemoItem( diff --git a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt index 95791b66f..7f01489be 100644 --- a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/Playlist.kt @@ -57,10 +57,10 @@ data class Playlist(val title: String, val items: List, val descriptio imageUrl = "https://www.rts.ch/2022/08/18/12/38/13317144.image/16x9" ), DemoItem( - title = "The dig", - uri = "https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4", - description = "VOD - MP4", - imageUrl = "https://www.swissinfo.ch/resource/image/47686506/landscape_ratio3x2/280/187/347ee14103b1b86184659b2fd04c69ba/8C028539EC620EFACC0BF2F61591E2F8/img_8527.jpg" + title = "Swiss wheelchair athlete wins top award", + uri = "https://cdn.prod.swi-services.ch/video-projects/94f5f5d1-5d53-4336-afda-9198462c45d9/localised-videos/ENG/renditions/ENG.mp4", + description = "VOD - MP4 (urn:swi:video:48498670)", + imageUrl = "https://cdn.prod.swi-services.ch/video-delivery/images/94f5f5d1-5d53-4336-afda-9198462c45d9/_.1hAGinujJ.yERGrrGNzBGCNSxmhKZT/16x9" ), DemoItem( title = "Couleur 3 en vidéo (live)", diff --git a/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/MediaItemSourceTest.kt b/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/MediaItemSourceTest.kt index 225e813f5..14eb5446f 100644 --- a/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/MediaItemSourceTest.kt +++ b/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/MediaItemSourceTest.kt @@ -11,6 +11,7 @@ import androidx.media3.common.util.ConditionVariable import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import ch.srgssr.pillarbox.player.data.MediaItemSource +import ch.srgssr.pillarbox.player.utils.ContentUrls import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith @@ -29,7 +30,7 @@ class MediaItemSourceTest { // Context of the app under test. val appContext = getInstrumentation().targetContext val customTag = "TagForTest" - val url = "https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4" + val url = ContentUrls.VOD_MP4 val atomicPlayer = AtomicReference() val waitForReady = WaitReadyListener() getInstrumentation().runOnMainSync { diff --git a/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/utils/ContentUrls.kt b/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/utils/ContentUrls.kt index bac24f2c5..c1b77df96 100644 --- a/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/utils/ContentUrls.kt +++ b/pillarbox-player/src/androidTest/java/ch/srgssr/pillarbox/player/utils/ContentUrls.kt @@ -6,8 +6,8 @@ package ch.srgssr.pillarbox.player.utils object ContentUrls { const val VOD_HLS = "https://swi-vod.akamaized.net/videoJson/47603186/master.m3u8" - const val VOD_MP4 = - "https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4" + // From urn:swi:video:48940210 + const val VOD_MP4 = "https://cdn.prod.swi-services.ch/video-projects/141b30ce-3850-424b-9063-a20d5619d342/localised-videos/ENG/renditions/ENG.mp4" const val VOD_DASH_H264 = "https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd" const val VOD_DASH_H265 = "https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd" const val LIVE_HLS = "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0" From 912dc897e8c4f728e0a820c0caf8664e2e063999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Fri, 23 Feb 2024 16:57:10 +0100 Subject: [PATCH 4/4] Update pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaëtan Muller --- .../main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt index 7816db6fb..75f7168b3 100644 --- a/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/data/DemoItem.kt @@ -74,7 +74,7 @@ data class DemoItem( val OnDemandVideoMP4 = DemoItem( title = "VOD - MP4", - description = "urn:swi:video:48498670", + description = "Swiss wheelchair athlete wins top award", uri = "https://cdn.prod.swi-services.ch/video-projects/94f5f5d1-5d53-4336-afda-9198462c45d9/localised-videos/ENG/renditions/ENG.mp4" )