mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added webYouTubeVideoCreate and improved web docs.
This commit is contained in:
parent
81ce04eb7b
commit
526441a547
@ -141,7 +141,7 @@ void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char*
|
||||
Result webWifiShow(WebWifiConfig* config, WebWifiReturnValue *out);
|
||||
|
||||
/**
|
||||
* @brief Creates the config for WebApplet. This applet uses an URL whitelist loaded from the user-process host title.
|
||||
* @brief Creates the config for WebApplet. This applet uses an URL whitelist loaded from the user-process host title, when running under an Application. Content mounting *must* be successful otherwise the applet will throw a fatalerr.
|
||||
* @note Sets WebArgType_UnknownD, and WebArgType_Unknown12 on pre-3.0.0, to value 1.
|
||||
* @param config WebCommonConfig object.
|
||||
* @param url Initial URL navigated to by the applet.
|
||||
@ -157,6 +157,15 @@ Result webPageCreate(WebCommonConfig* config, const char* url);
|
||||
*/
|
||||
Result webNewsCreate(WebCommonConfig* config, const char* url);
|
||||
|
||||
/**
|
||||
* @brief Creates the config for WebApplet. This is based on \ref webPageCreate, for YouTubeVideo. Hence other functions referencing \ref webPageCreate also apply to this. This uses a whitelist which essentially only allows youtube embed/ URLs (without mounting content from the host title).
|
||||
* @note This is only available on [5.0.0+].
|
||||
* @note Sets WebArgType_UnknownD to value 1, and sets WebArgType_YouTubeVideoFlag to true. Also uses \ref webConfigSetBootAsMediaPlayer with flag=true.
|
||||
* @param config WebCommonConfig object.
|
||||
* @param url Initial URL navigated to by the applet.
|
||||
*/
|
||||
Result webYouTubeVideoCreate(WebCommonConfig* config, const char* url);
|
||||
|
||||
/**
|
||||
* @brief Sets the CallbackUrl.
|
||||
* @note Only available with config created by \ref webPageCreate or with Share-applet.
|
||||
|
@ -194,6 +194,21 @@ Result webNewsCreate(WebCommonConfig* config, const char* url) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result webYouTubeVideoCreate(WebCommonConfig* config, const char* url) {
|
||||
Result rc=0;
|
||||
if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
_webArgInitialize(config, AppletId_web, WebShimKind_Web);
|
||||
|
||||
rc = _webConfigSetU8(config, WebArgType_UnknownD, 1);
|
||||
if (R_SUCCEEDED(rc)) rc = _webConfigSetFlag(config, WebArgType_YouTubeVideoFlag, true);
|
||||
if (R_SUCCEEDED(rc)) rc = webConfigSetBootAsMediaPlayer(config, true);
|
||||
|
||||
if (R_SUCCEEDED(rc)) rc = _webConfigSetUrl(config, url);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result webConfigSetCallbackUrl(WebCommonConfig* config, const char* url) {
|
||||
WebShimKind shim = _webGetShimKind(config);
|
||||
if (shim != WebShimKind_Share && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
Loading…
Reference in New Issue
Block a user