Skip to content

Commit

Permalink
webkit-utils: Check if the media engine will show the resource
Browse files Browse the repository at this point in the history
cog_handle_web_view_load_failed() checks if the error is WEBKIT_MEDIA_ERROR
or WEBKIT_MEDIA_ERROR_WILL_HANDLE_LOAD and relies on WebKit in these cases.

Similarly it does the same for the case of WPE API previous to 2.0 but using
WEBKIT_PLUGIN_ERROR and WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD.

This reverts commit c7bdb9c.
  • Loading branch information
psaavedra committed May 12, 2023
1 parent c51d94e commit 8e1acd3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/cog-webkit-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ cog_handle_web_view_load_failed (WebKitWebView *web_view,
GError *error,
void *userdata)
{
// If the resource is going to be shown by a plug-in or a
// media engine (for the case of API WPE2) just return FALSE and
// let WebKit handle it.
#if COG_USE_WPE2
if (g_error_matches(error, WEBKIT_MEDIA_ERROR, WEBKIT_MEDIA_ERROR_WILL_HANDLE_LOAD))
#else
if (g_error_matches(error, WEBKIT_PLUGIN_ERROR, WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD))
#endif
return FALSE;

// Ignore cancellation errors as the active URI may be changing
if (g_error_matches (error,
WEBKIT_NETWORK_ERROR,
Expand Down

0 comments on commit 8e1acd3

Please sign in to comment.