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)) } 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..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,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 = "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" ) 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 87b51616e..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)", @@ -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" ) 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"