mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 10:11:10 +00:00
Adds the audio player transport UI and its three state progress bar.
This commit is contained in:
1 parent
a8e85d0673
commit
0c6de6b392
20 files changed
+1433
-67
No files matched your search
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>إيقاف</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>جارٍ التخزين المؤقت</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>كتم الصوت</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>إيقاف مؤقت</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>تشغيل</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>موضع التشغيل</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>إلغاء كتم الصوت</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>مستوى الصوت</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>إلغاء</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Abbrechen</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Wird gepuffert</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Stummschalten</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pause</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Abspielen</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Wiedergabeposition</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Stummschaltung aufheben</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Lautstärke</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Abbrechen</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Abort</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Buffering</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Mute</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pause</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Play</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Playback position</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Unmute</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volume</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Anular</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Cargando</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Silenciar</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pausa</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Reproducir</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Posición de reproducción</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Activar sonido</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volumen</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancelar</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Abandonner</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Mise en mémoire tampon</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Muet</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pause</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Lecture</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Position de lecture</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Activer le son</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volume</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Annuler</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Interrompi</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Caricamento in corso</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Disattiva audio</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pausa</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Riproduci</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Posizione di riproduzione</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Riattiva audio</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volume</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Annulla</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>中止する</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>バッファリング中</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>ミュート</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>一時停止</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>再生</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>再生位置</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>ミュート解除</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>音量</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>キャンセル</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Abort</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Buffering</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Mute</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pause</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Play</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Playback position</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Unmute</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volume</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Anulare</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Se încarcă</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Fără sunet</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Pauză</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Redare</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Poziția de redare</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Activează sunetul</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Volum</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Anulare</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>Перервати</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>Буферизація</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>Вимкнути звук</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>Пауза</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>Відтворити</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>Позиція відтворення</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>Увімкнути звук</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>Гучність</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Скасувати</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,27 @@
|
||||
<data name="Abort" xml:space="preserve">
|
||||
<value>中止</value>
|
||||
</data>
|
||||
<data name="AudioPlayerBuffering" xml:space="preserve">
|
||||
<value>缓冲中</value>
|
||||
</data>
|
||||
<data name="AudioPlayerMute" xml:space="preserve">
|
||||
<value>静音</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPause" xml:space="preserve">
|
||||
<value>暂停</value>
|
||||
</data>
|
||||
<data name="AudioPlayerPlay" xml:space="preserve">
|
||||
<value>播放</value>
|
||||
</data>
|
||||
<data name="AudioPlayerSeek" xml:space="preserve">
|
||||
<value>播放位置</value>
|
||||
</data>
|
||||
<data name="AudioPlayerUnmute" xml:space="preserve">
|
||||
<value>取消静音</value>
|
||||
</data>
|
||||
<data name="AudioPlayerVolume" xml:space="preserve">
|
||||
<value>音量</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>取消</value>
|
||||
</data>
|
||||
|
||||
@@ -20,13 +20,29 @@
|
||||
|
||||
The DOM contract a theme must preserve is:
|
||||
- The container element with the 'audio-player-container' class, carrying 'not-shown' while the bar is hidden,
|
||||
and 'full-height' while it is expanded. The audio player toggles both classes.
|
||||
and 'full-height' while it is expanded. The audio player toggles both classes. While the bar is hidden the
|
||||
player also sets the 'inert' attribute on it, and removes it when the bar is shown, so a collapsed bar keeps
|
||||
none of its focusable controls in the tab order.
|
||||
- The main content element, carrying 'audio-player-not-shown' while the bar is hidden, and 'audio-player-full-height'
|
||||
while it is expanded. The audio player toggles both classes on it as well.
|
||||
- The elements with the ids 'audio-player-full-height-toggle' and 'audio-player-close', which the global site script
|
||||
binds and routes to the audio player.
|
||||
- The hook attributes the audio player binds: 'data-audio-player-play-pause', '-progress', '-progress-played',
|
||||
'-progress-downloaded', '-current-time', '-total-time', '-track-name', '-cover-thumbnail', '-cover-image' and '-queue'.
|
||||
'-progress-downloaded', '-progress-undownloaded', '-current-time', '-total-time', '-track-name',
|
||||
'-cover-thumbnail', '-cover-image', '-volume', '-volume-level', '-mute' and '-queue'. The volume fill element
|
||||
('-volume-level') is a styling hook the stylesheet drives from the custom properties below, not one the script
|
||||
writes to.
|
||||
- The three state progress bar: the played part carries 'audio-player-progress-played', the downloaded but not
|
||||
played part carries 'audio-player-progress-downloaded', and the not yet downloaded part carries
|
||||
'audio-player-progress-undownloaded'. Each layer also carries 'data-audio-player-progress-layer' ('played',
|
||||
'downloaded' or 'undownloaded') in the markup, so a theme can select a layer by state as well as by class. The
|
||||
player publishes the start and the width of each state as the CSS custom properties
|
||||
'--audio-player-progress-played-start', '-played-width', '-downloaded-start', '-downloaded-width',
|
||||
'-undownloaded-start' and '-undownloaded-width' on the bar, and the volume fill as
|
||||
'--audio-player-volume-start' and '--audio-player-volume-width' on the volume control, and writes no inline
|
||||
geometry, so a theme consumes the properties to style each state and to give either bar its own shape and
|
||||
orientation. The player marks the bar with 'is-buffering' while it is loading, and carries the state in
|
||||
'data-audio-player-progress-state' ('idle', 'ready' or 'buffering') together with the slider ARIA attributes.
|
||||
- The plain text script elements that carry the raw source of the 'shared/audio-player/queue-item' and
|
||||
'shared/audio-player/playlist-item' sub templates, with the ids 'audio-player-template-queue-item' and
|
||||
'audio-player-template-playlist-item'.
|
||||
@@ -41,21 +57,32 @@
|
||||
<img class="audio-player-cover-image" data-audio-player-cover-image alt="" />
|
||||
<ul class="audio-player-queue" data-audio-player-queue></ul>
|
||||
</div>
|
||||
<!-- Condensed bar: transport control, progress bar and track name. -->
|
||||
<!-- Condensed bar: transport controls, three state progress bar, volume, and track name. -->
|
||||
<div class="audio-player-bar">
|
||||
<img class="audio-player-cover-thumbnail" data-audio-player-cover-thumbnail alt="" />
|
||||
<span class="audio-player-track-name" data-audio-player-track-name></span>
|
||||
<span class="audio-player-time audio-player-current-time" data-audio-player-current-time>0:00</span>
|
||||
<div class="audio-player-progress" data-audio-player-progress>
|
||||
<div class="audio-player-progress-downloaded" data-audio-player-progress-downloaded></div>
|
||||
<div class="audio-player-progress-played" data-audio-player-progress-played></div>
|
||||
<div class="audio-player-progress" data-audio-player-progress data-audio-player-progress-state="idle" role="slider" tabindex="0"
|
||||
aria-label="@localizer["AudioPlayerSeek"]" aria-valuemin="0" aria-valuemax="1" aria-valuenow="0" aria-busy="false">
|
||||
<div class="audio-player-progress-undownloaded" data-audio-player-progress-undownloaded data-audio-player-progress-layer="undownloaded"></div>
|
||||
<div class="audio-player-progress-downloaded" data-audio-player-progress-downloaded data-audio-player-progress-layer="downloaded"></div>
|
||||
<div class="audio-player-progress-played" data-audio-player-progress-played data-audio-player-progress-layer="played"></div>
|
||||
</div>
|
||||
<span class="audio-player-time audio-player-total-time" data-audio-player-total-time>--:--</span>
|
||||
<div class="audio-player-transport">
|
||||
<button type="button" class="audio-player-button audio-player-play-pause" data-audio-player-play-pause>
|
||||
<button type="button" class="audio-player-button audio-player-play-pause" data-audio-player-play-pause aria-label="@localizer["AudioPlayerPlay"]">
|
||||
<span class="audio-player-play-pause-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="audio-player-volume-control">
|
||||
<button type="button" class="audio-player-button audio-player-mute" data-audio-player-mute aria-label="@localizer["AudioPlayerMute"]" aria-pressed="false">
|
||||
<span class="audio-player-mute-icon"></span>
|
||||
</button>
|
||||
<div class="audio-player-volume" data-audio-player-volume role="slider" tabindex="0"
|
||||
aria-label="@localizer["AudioPlayerVolume"]" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100">
|
||||
<div class="audio-player-volume-level" data-audio-player-volume-level></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="audio-player-controls">
|
||||
<button type="button" id="audio-player-full-height-toggle">@localizer["ToggleFullHeight"]</button>
|
||||
<button type="button" id="audio-player-close">@localizer["ToggleVisibility"]</button>
|
||||
|
||||
@@ -33,13 +33,31 @@
|
||||
error: '@localizer["Error"]',
|
||||
information: '@localizer["Information"]'
|
||||
};
|
||||
// The endpoints the audio player reads the stored playback preferences of the user from. The routes are the culture
|
||||
// aware web routes, so the player never hardcodes a path, and it never reaches the API server directly.
|
||||
// The endpoints the audio player reads the stored playback preferences of the user from, and writes the volume and
|
||||
// mute state it changes back to. The routes are the culture aware web routes, so the player never hardcodes a path,
|
||||
// and it never reaches the API server directly.
|
||||
var audioPlayerConfiguration = {
|
||||
getUserSettingsUrl: '@_urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_USER_SETTINGS)',
|
||||
getPlaybackStateUrl: '@_urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_PLAYBACK_STATE)'
|
||||
getPlaybackStateUrl: '@_urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_PLAYBACK_STATE)',
|
||||
updatePlaybackStateUrl: '@_urlService.GetAbsoluteUrl(WebRoutes.Settings.UPDATE_PLAYBACK_STATE)',
|
||||
strings: {
|
||||
play: '@localizer["AudioPlayerPlay"]',
|
||||
pause: '@localizer["AudioPlayerPause"]',
|
||||
mute: '@localizer["AudioPlayerMute"]',
|
||||
unmute: '@localizer["AudioPlayerUnmute"]',
|
||||
volume: '@localizer["AudioPlayerVolume"]',
|
||||
seek: '@localizer["AudioPlayerSeek"]',
|
||||
buffering: '@localizer["AudioPlayerBuffering"]'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@if (User?.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
<!-- The audio player writes the volume and mute state it changes to the playback state endpoint, which validates an
|
||||
anti-forgery token. The player is rendered only for an authenticated visitor, so the token is rendered here too,
|
||||
once, with the global configuration, whatever the active theme is. -->
|
||||
@Html.AntiForgeryToken()
|
||||
}
|
||||
<script src="~/libs/microsoft-signalr/signalr.min.js" asp-append-version="true"></script>
|
||||
<script defer src="~/js/notifications.js" asp-append-version="true"></script>
|
||||
<script defer src="~/js/dialogs.js" asp-append-version="true"></script>
|
||||
|
||||
Reference in new issue
Block a user