mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 00:10:57 +00:00 
			
		
		
		
	Support streaming media from jellyfin
This commit is contained in:
		
							parent
							
								
									8ef88f2153
								
							
						
					
					
						commit
						713cb217e4
					
				@ -29,17 +29,19 @@ function ticksToString(ticks) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function SingleSessionEntry({ playCommand, session }) {
 | 
					function SingleSessionEntry({ playCommand, session }) {
 | 
				
			||||||
  const {
 | 
					  const {
 | 
				
			||||||
    NowPlayingItem: { Name, SeriesName, RunTimeTicks },
 | 
					    NowPlayingItem: { Name, SeriesName },
 | 
				
			||||||
    PlayState: { PositionTicks, IsPaused, IsMuted },
 | 
					    PlayState: { PositionTicks, IsPaused, IsMuted },
 | 
				
			||||||
  } = session;
 | 
					  } = session;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const RunTimeTicks = session.NowPlayingItem?.RunTimeTicks ?? session.NowPlayingItem?.CurrentProgram?.RunTimeTicks ?? 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || {
 | 
					  const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || {
 | 
				
			||||||
    IsVideoDirect: true,
 | 
					    IsVideoDirect: true,
 | 
				
			||||||
    VideoDecoderIsHardware: true,
 | 
					    VideoDecoderIsHardware: true,
 | 
				
			||||||
    VideoEncoderIsHardware: true,
 | 
					    VideoEncoderIsHardware: true,
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const percent = (PositionTicks / RunTimeTicks) * 100;
 | 
					  const percent = Math.min(1, PositionTicks / RunTimeTicks) * 100;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <>
 | 
					    <>
 | 
				
			||||||
@ -98,13 +100,15 @@ function SingleSessionEntry({ playCommand, session }) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function SessionEntry({ playCommand, session }) {
 | 
					function SessionEntry({ playCommand, session }) {
 | 
				
			||||||
  const {
 | 
					  const {
 | 
				
			||||||
    NowPlayingItem: { Name, SeriesName, RunTimeTicks },
 | 
					    NowPlayingItem: { Name, SeriesName },
 | 
				
			||||||
    PlayState: { PositionTicks, IsPaused, IsMuted },
 | 
					    PlayState: { PositionTicks, IsPaused, IsMuted },
 | 
				
			||||||
  } = session;
 | 
					  } = session;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const RunTimeTicks = session.NowPlayingItem?.RunTimeTicks ?? session.NowPlayingItem?.CurrentProgram?.RunTimeTicks ?? 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || {};
 | 
					  const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const percent = (PositionTicks / RunTimeTicks) * 100;
 | 
					  const percent = Math.min(1, PositionTicks / RunTimeTicks) * 100;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div className="text-theme-700 dark:text-theme-200 relative h-5 w-full rounded-md bg-theme-200/50 dark:bg-theme-900/20 mt-1 flex">
 | 
					    <div className="text-theme-700 dark:text-theme-200 relative h-5 w-full rounded-md bg-theme-200/50 dark:bg-theme-900/20 mt-1 flex">
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user