0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-17 00:35:16 +00:00
VueTube/NUXT/plugins/renderers.js

29 lines
844 B
JavaScript
Raw Normal View History

// General utility functions for the renderers
class rendererUtils {
static getNavigationEndpoints(base) {
const navEndpoint = base.navigationEndpoint;
if (!navEndpoint) return;
if (navEndpoint.webviewEndpoint) {
return navEndpoint.webviewEndpoint.url;
} else if (navEndpoint.browseEndpoint) {
return navEndpoint.browseEndpoint.canonicalBaseUrl;
} else if (navEndpoint.watchEndpoint) {
return `/watch?v=${navEndpoint.watchEndpoint.videoId}`;
} else if (navEndpoint.navigationEndpoint) {
return; //for now
}
2022-03-21 23:47:11 +00:00
}
static checkInternal(base) {
const navEndpoint = base.navigationEndpoint;
if (!navEndpoint) return false;
if (navEndpoint.browseEndpoint || navEndpoint.watchEndpoint) {
return true;
} else {
return false;
}
}
}
export default rendererUtils;