Fix static content not switching: hard navigate when no active media
This commit is contained in:
parent
309c291a92
commit
7574318ba8
1 changed files with 10 additions and 2 deletions
|
|
@ -175,12 +175,20 @@
|
|||
function transitionTo(data) {
|
||||
var isPlayable = (data.media_type === 'video' || data.media_type === 'audio');
|
||||
|
||||
if (isPlayable && activeMedia && data.media_type === currentMediaType) {
|
||||
// From a static page, always hard navigate (no media container to swap into)
|
||||
if (!activeMedia) {
|
||||
if (data.canonical_url) {
|
||||
window.location.href = data.canonical_url;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPlayable && data.media_type === currentMediaType) {
|
||||
crossfade(data);
|
||||
} else if (isPlayable) {
|
||||
hardSwap(data);
|
||||
} else {
|
||||
// Static content (PDF, image, etc.) — hard navigate
|
||||
// Next item is static content — hard navigate
|
||||
if (data.canonical_url) {
|
||||
window.location.href = data.canonical_url;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue