Skip to content

Catch errors while loading the nonlinear image#90

Open
ceyhun-o wants to merge 1 commit into
masterfrom
bugfix/yospace/image-crash
Open

Catch errors while loading the nonlinear image#90
ceyhun-o wants to merge 1 commit into
masterfrom
bugfix/yospace/image-crash

Conversation

@ceyhun-o
Copy link
Copy Markdown
Contributor

This fixes a fatal exception if the non-linear image cannot be loaded (eg. because the link returns 403/404).

FATAL EXCEPTION: main
Process: com.theoplayer.android.connector, PID: 5023
java.io.FileNotFoundException: https://d132xhhrp9rfus.cloudfront.net/yosdk02/config/nonlinear.png
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30)
	at java.net.URL.openStream(URL.java:1072)
	at com.theoplayer.android.connector.yospace.YospaceDefaultUiHandler$showNonLinear$loadJob$1$imageBitmap$1.invokeSuspend(YospaceDefaultUiHandler.kt:75)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ce7fb3f, Dispatchers.Main]

We can instead catch this and log a warning. This can be reproduced on the following stream:

        Source(
            name = "Yospace HLS VOD",
            sourceDescription = SourceDescription
                .Builder(
                    TypedSource.Builder(
                        "https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/access/671396665/aGxzL2hscy1tYXN0ZXIubTN1OA==?yo.av=4"
                    )
                        .type(SourceType.HLS)
                        .ssai(YospaceSsaiDescription(streamType = YospaceStreamType.VOD))
                        .build()
                )
                .build()
        ),

@ceyhun-o ceyhun-o added the 🔌 connector: yospace Affects the Yospace connector label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔌 connector: yospace Affects the Yospace connector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant