1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Daniel Neto 2023-05-15 09:34:07 -03:00
parent baa405f93b
commit dad7169340
2 changed files with 14 additions and 2 deletions

View file

@ -1719,10 +1719,22 @@ function avideoModalIframeRemove() {
}
}
function json_decode(jsonString){
if (typeof jsonString === 'string') {
try {
return JSON.parse(jsonString);
} catch (error) {
console.error('Invalid JSON string:', error);
}
}
return jsonString;
}
function avideoResponse(response) {
//console.log('avideoResponse', response);
if (typeof response === 'string') {
response = JSON.parse(response);
response = json_decode(response);
}
//console.log('avideoResponse', response);
if (response.error) {