use only supported continents
This commit is contained in:
parent
7afaeb8333
commit
6d12e0da06
1 changed files with 11 additions and 1 deletions
|
@ -12,7 +12,7 @@ function generateStreamUrl(claimName, claimId, apiUrl) {
|
|||
prefix = prefix.replace('//', '//' + continent + '.');
|
||||
} else {
|
||||
Lbryio.call('locale', 'get', {}, 'post').then(result => {
|
||||
const userContinent = result.continent;
|
||||
const userContinent = getSupportedCDN(result.continent);
|
||||
setCookie(CONTINENT_COOKIE, userContinent, 1);
|
||||
});
|
||||
}
|
||||
|
@ -20,6 +20,16 @@ function generateStreamUrl(claimName, claimId, apiUrl) {
|
|||
return `${prefix}/content/claims/${claimName}/${claimId}/stream`;
|
||||
}
|
||||
|
||||
function getSupportedCDN(continent) {
|
||||
switch (continent) {
|
||||
case 'NA':
|
||||
case 'EU':
|
||||
return continent;
|
||||
default:
|
||||
return 'NA';
|
||||
}
|
||||
}
|
||||
|
||||
function generateEmbedUrl(claimName, claimId) {
|
||||
return `${URL}/$/embed/${claimName}/${claimId}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue