| 
						
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -1,18 +1,16 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				// Audio Player
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import React, { useEffect, useRef } from 'react';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import H5AudioPlayer from 'react-h5-audio-player';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import React, { useEffect, useRef, useState } from 'react';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import H5AudioPlayer, { RHAP_UI } from 'react-h5-audio-player';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { useTheme } from 'styled-components';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { useEncryptedFileFetch } from '../../hooks/useEncryptedFileFetch';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { SessionIcon, SessionIconSize, SessionIconType } from '../session/icon';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { SessionIcon, SessionIconButton, SessionIconSize, SessionIconType } from '../session/icon';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				export const AudioPlayerWithEncryptedFile = (props: {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  src: string;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  contentType: string;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  playbackSpeed: number;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}) => {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				export const AudioPlayerWithEncryptedFile = (props: { src: string; contentType: string }) => {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  const theme = useTheme();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  const [playbackSpeed, setPlaybackSpeed] = useState(1.0);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  const { urlToLoad } = useEncryptedFileFetch(props.src, props.contentType);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  const { playbackSpeed } = props;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  const player = useRef<H5AudioPlayer | null>(null);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  useEffect(() => {
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -31,6 +29,21 @@ export const AudioPlayerWithEncryptedFile = (props: {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      showDownloadProgress={false}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      listenInterval={100}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      ref={player}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      customControlsSection={[
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        RHAP_UI.MAIN_CONTROLS,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        RHAP_UI.VOLUME,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        <div className="speedButton" key="togglePlaybackSpeed">
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				          <SessionButton
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            text={`${playbackSpeed}x`}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            theme={theme}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            onClick={() => {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				              setPlaybackSpeed(playbackSpeed === 1 ? 1.5 : 1);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            buttonType={SessionButtonType.Simple}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            buttonColor={SessionButtonColor.None}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				          />
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        </div>,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      ]}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      customIcons={{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        play: (
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				          <SessionIcon
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |