Spaces:
Running
Running
Upload static/yt_live.js with huggingface_hub
Browse files- static/yt_live.js +13 -2
static/yt_live.js
CHANGED
|
@@ -394,11 +394,22 @@
|
|
| 394 |
};
|
| 395 |
}
|
| 396 |
|
| 397 |
-
// Override switchCat
|
| 398 |
const _origSwitchCat = window.switchCat;
|
| 399 |
if(_origSwitchCat){
|
| 400 |
window.switchCat = function(id){
|
| 401 |
-
if(id!=='view-home' && _currentCh && STREAMS[_currentCh] && STREAMS[_currentCh].length>0 && !_miniActive)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
return _origSwitchCat.apply(this, arguments);
|
| 403 |
};
|
| 404 |
}
|
|
|
|
| 394 |
};
|
| 395 |
}
|
| 396 |
|
| 397 |
+
// Override switchCat — activate mini when leaving home, auto-hide when returning
|
| 398 |
const _origSwitchCat = window.switchCat;
|
| 399 |
if(_origSwitchCat){
|
| 400 |
window.switchCat = function(id){
|
| 401 |
+
if(id!=='view-home' && _currentCh && STREAMS[_currentCh] && STREAMS[_currentCh].length>0 && !_miniActive){
|
| 402 |
+
activateMiniPlayer();
|
| 403 |
+
}
|
| 404 |
+
// Auto-hide mini player when returning to home
|
| 405 |
+
if(id==='home' && _miniActive){
|
| 406 |
+
const mini = document.getElementById('vtv-mini');
|
| 407 |
+
if(mini){
|
| 408 |
+
mini.classList.remove('show');
|
| 409 |
+
mini.classList.add('hidden');
|
| 410 |
+
}
|
| 411 |
+
_miniActive = false;
|
| 412 |
+
}
|
| 413 |
return _origSwitchCat.apply(this, arguments);
|
| 414 |
};
|
| 415 |
}
|