Skip to content

Commit

Permalink
#167 save space for player in layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ephes committed Oct 30, 2024
1 parent 56d34ae commit ed8506a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions cast/static/cast/css/bootstrap4/cast.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,15 @@
*/
display: block;
}

.podlove-player-container {
width: 936px; /* Desktop width */
height: 300px; /* Desktop height */
}

@media (max-width: 768px) {
.podlove-player-container {
width: 366px; /* Mobile width */
height: 500px; /* Mobile height */
}
}
1 change: 1 addition & 0 deletions cast/templates/cast/audio/audio.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% if page.pk %}
<div
id="audio_{{ value.pk }}"
class="podlove-player-container"
data-variant="xl"
data-url="{% url 'cast:api:audio_podlove_detail' pk=value.pk post_id=page.pk %}"
>
Expand Down
2 changes: 1 addition & 1 deletion cast/templates/cast/bootstrap4/blog_list_of_posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h5 class="mb-0">
}

function initializePodlovePlayers() {
document.querySelectorAll('section.block-audio div[id^="audio_"]').forEach(div => {
document.querySelectorAll('.podlove-player-container').forEach(div => {
initializePodlovePlayerWhenVisible(div);
});
}
Expand Down
1 change: 1 addition & 0 deletions docs/releases/0.2.40.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
Improved the performance of the web player by
- #167 Waiting for the load event before initializing the player (instead of using DOMContentLoaded)
- #167 Only initializing the player once the player is visible in the viewport
- #167 Save space for the player in the layout, even if it's not visible

0 comments on commit ed8506a

Please sign in to comment.