瀏覽代碼

Recording Seek (#7163)

anthony-ricci 10 月之前
父節點
當前提交
08e9edc858
共有 2 個文件被更改,包括 15 次插入1 次删除
  1. 2 1
      themes/default/css.php
  2. 13 0
      themes/default/template.php

+ 2 - 1
themes/default/css.php

@@ -2049,6 +2049,7 @@ else { //default: white
 		-webkit-box-shadow: 0 0 3px 0px rgba(<?=hex_to_rgb($audio_player_indicator_color,',',true,0.8)?>);
 		-moz-box-shadow: 0 0 3px 0px rgba(<?=hex_to_rgb($audio_player_indicator_color,',',true,0.8)?>);
 		box-shadow: 0 0 3px 0px rgba(<?=hex_to_rgb($audio_player_indicator_color,',',true,0.8)?>);
+		pointer-events: none;
 		}
 
 	td.vtable.playback_progress_bar_background,
@@ -2063,7 +2064,7 @@ else { //default: white
 		background-image: linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, transparent 100%);
 		overflow: hidden;
 		<?php if ($audio_player_waveform_enabled === 'true') { ?>
-			padding-bottom: 3px;
+			padding-bottom: 0px;
 			background-size: 100% 100% !important;
 			background-repeat: no-repeat;
 			cursor: pointer;

+ 13 - 0
themes/default/template.php

@@ -821,6 +821,19 @@
 			}
 		}
 
+		function recording_seek(event, player_id, data, audio_type) {
+			if (recording_audio) {
+				if (document.getElementById('playback_progress_bar_background_' + player_id)) {
+					audio_player = document.getElementById('playback_progress_bar_background_' + player_id);
+				}
+				else if (document.getElementById('recording_progress_bar_' + player_id)) {
+					audio_player = document.getElementById('recording_progress_bar_' + player_id);
+				}
+				recording_audio.currentTime = (event.offsetX / audio_player.offsetWidth) * recording_audio.duration;
+				update_progress(recording_id_playing);
+			}
+		}
+
 		{/literal}
 
 	//handle action bar style on scroll