mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
parent
baa405f93b
commit
dad7169340
2 changed files with 14 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue