Session errors
getURL error codes
Session creation errors
Creating a session through the getURL
method returns a StreamingSessionResult
object.
The result contains:
- a success status: the session is started and a streaming URL can be passed to the player
- or an error code: the session has to be stopped and the app has to trigger a specific behavior
- Android
- iOS & tvOS
- Web
// Get the error code
int errorCode = result.getErrorCode();
// For some error codes, a detailed error code is specified
int detailedErrorCode = result.getDetailedErrorCode();
String detailedErrorMessage = result.getDetailedErrorMessage();
// Get the error code
int errorCode = [result getErrorCode];
// For some error codes, a detailed error code is specified
int detailedErrorCode = [result getDetailedErrorCode];
NSString *detailedErrorMessage = [result getDetailedErrorMessage];
// Get the error code
const errorCode = result.getErrorCode();
// For some error codes, a detailed error code is specified
const detailedErrorCode = result.getDetailedErrorCode();
const detailedErrorMessage = result.getDetailedErrorMessage();
All error codes and detailed error codes are specified below.
Code example:
- Android
- iOS & tvOS
- Web
// Try to start a session
StreamingSessionResult result = session.getURL(VIDEO_URL1);
// The session result is ending with an error
if (result.isError()) {
// Get the error code
int errorCode = result.getErrorCode();
// For some error codes, a detailed error code is specified
int detailedErrorCode = result.getDetailedErrorCode();
switch (errorCode) {
case StreamingSessionResult.RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN: // Error 4XX returned by the CDN (BkM/uCDN/Broadpeak.io)
if (detailedErrorCode == 404) {
// example: show channel not found message
} else if (detailedErrorCode == 401) {
// example: trigger authentication
} else if (detailedErrorCode == 2000) {
// example: show cdn error
}
break;
}
// Stop the session
session.stopStreamingSession();
} else {
// No error, pass the streaming URL to the player
}
// Try to start a session
StreamingSessionResult *result = [session getURL:VIDEO_URL1];
// The session result is ending with an error
if ([result isError]) {
// Get the error code
int errorCode = [result getErrorCode];
// For some error codes, a detailed error code is specified
int detailedErrorCode = [result getDetailedErrorCode];
switch (errorCode) {
case SMARTLIB_RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN: // Error 4XX returned by the CDN (BkM/uCDN/Broadpeak.io)
if (detailedErrorCode == 404) {
// example: show channel not found message
} else if (detailedErrorCode == 401) {
// example: trigger authentication
} else if (detailedErrorCode == 2000) {
// example: show cdn error
}
break;
}
// Stop the session
[session stopStreamingSession];
} else {
// No error, pass the streaming URL to the player
}
// Try to start a session
const result = await session.getURL(VIDEO_URL1);
// The session result is ending with an error
if (result.isError()) {
// Get the error code
const errorCode = result.getErrorCode();
// For some error codes, a detailed error code is specified
const detailedErrorCode = result.getDetailedErrorCode();
switch (errorCode) {
case StreamingSessionResult.RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN: // Error 4XX returned by the CDN (BkM/uCDN/Broadpeak.io)
if (detailedErrorCode == 404) {
// example: show channel not found message
} else if (detailedErrorCode == 401) {
// example: trigger authentication
} else if (detailedErrorCode == 2000) {
// example: show cdn error
}
break;
}
// Stop the session
session.stopStreamingSession();
} else {
// No error, pass the streaming URL to the player
}
Result error codes
Name | Code | Description |
---|---|---|
RESULT_NO_STREAMING_URL_FOUND | 3100 | Unknown error when requesting the CDN (BkM/uCDN/Broadpeak.io). Detailed error code: CDN status code if available or RESULT_NO_DETAILED_ERROR. |
RESULT_CDN_RESPONSE_UNREADABLE | 3101 | Timeout error, CORS error or connection error when requesting the CDN (BkM/uCDN/Broadpeak.io). No detailed error code. |
RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN | 3102 | Error 4XX returned by the CDN (BkM/uCDN/Broadpeak.io). Detailed error code: CDN status code. |
RESULT_REQUESTED_URL_NOT_FOUND_ON_NANOCDN | 3103 | Requested URL not found on the nanoCDN (404 error, content not found with multicast only enabled, unknown error). In case of gateway stacking, the detailed error code is set to the last nanoCDN request status code. Detailed error code: nanoCDN status code if available or RESULT_NO_DETAILED_ERROR. |
RESULT_REQUESTED_URL_CDN_ERROR | 3104 | Error 5XX returned by the CDN (BkM/uCDN/Broadpeak.io). Detailed error code: CDN status code. |
RESULT_NANOCDN_SESSION_LIMIT_REACHED | 3201 | All nanoCDN on the network responded with session limit reached error. In case of gateway stacking, the detailed error code is set to the last nanoCDN request status code. Detailed error code: nanoCDN status code. |
RESULT_NANOCDN_SESSION_LIMIT_REACHED_ON_REQUESTED_CHANNEL | 3202 | All nanoCDN on the network responded with session limit reached error for the requested channel. In case of gateway stacking, the detailed error code is set to the last nanoCDN request status code. Detailed error code: nanoCDN status code. |
RESULT_NANOCDN_SERVICE_UNAVAILABLE | 3203 | All nanoCDN on the network have their services unavailable. In case of gateway stacking, the detailed error code is set to the last nanoCDN request status code. Detailed error code: nanoCDN status code. |
RESULT_NANOCDN_CHANNEL_UNAVAILABLE | 3204 | The requested channel is unavailable on all nanoCDN of the network. In case of gateway stacking, the detailed error code is set to the last nanoCDN request status code. Detailed error code: nanoCDN status code. |
RESULT_NANOCDN_REQUEST_LOCAL_IF_CONNECTED_TO_WIFI_NOT_ALLOWED | 3205 | A nanoCDN on 127.0.0.1 has been found and is connected to Wi-Fi but it is not allowed. No detailed error code. |
RESULT_NANOCDN_RESPONSE_UNREADABLE | 3206 | Timeout error, CORS error or connection error when requesting the nanoCDN. No detailed error code. |
RESULT_API_PARAMETER_FORMAT_ERROR | 3400 | The requested URL is not a string or is empty. No detailed error code. |
RESULT_API_NOT_INITIALIZED | 3401 | API called while SmartLib is not initialized. No detailed error code. |
RESULT_SESSION_HAS_BEEN_STOPPED_DURING_REQUEST | 3402 | The session has been stopped during getURL request. No detailed error code. |
RESULT_REQUEST_ALREADY_DONE | 3403 | The request has already been done for that session (i.e getURL called twice). No detailed error code. |
info
On iOS & tvOS, all error names are prefixed by SMARTLIB_
Use SMARTLIB_RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN
for the error name RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN