-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement offline video playback for sonarr and RSS
- Loading branch information
Foxocube
committed
Jan 1, 2025
1 parent
76e071f
commit e2a45ab
Showing
7 changed files
with
79 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 25 additions & 3 deletions
28
MediaFeeder/MediaFeeder/Providers/DownloadedVideoFrame.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
@using Blazored.Video | ||
@using AntDesign | ||
@inherits VideoFrame | ||
|
||
<h3>DownloadedVideoFrame</h3> | ||
|
||
@code { | ||
|
||
} | ||
@if (Video != null) | ||
{ | ||
@if (Video.DownloadedPath != null) | ||
{ | ||
<BlazoredVideo CanPlay="CanPlay" | ||
Ended="Ended" | ||
CanPlayThrough="CanPlayThrough" | ||
class="w-100" | ||
controls="controls"> | ||
<source src="@Video.DownloadedPath" type="video/mp4"/> | ||
</BlazoredVideo> | ||
} | ||
else | ||
{ | ||
<h4>Video is not downloaded</h4> | ||
} | ||
} | ||
else | ||
{ | ||
<Skeleton/> | ||
} |
21 changes: 21 additions & 0 deletions
21
MediaFeeder/MediaFeeder/Providers/DownloadedVideoFrame.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Blazored.Video.Support; | ||
|
||
namespace MediaFeeder.Providers; | ||
|
||
public partial class DownloadedVideoFrame | ||
{ | ||
private void CanPlay(VideoState obj) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
private void Ended(VideoState obj) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
private void CanPlayThrough(VideoState obj) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using MediaFeeder.Data.db; | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace MediaFeeder.Providers; | ||
|
||
public abstract class VideoFrame : ComponentBase | ||
{ | ||
[Parameter] public Video? Video { get; set; } | ||
} |
3 changes: 2 additions & 1 deletion
3
MediaFeeder/MediaFeeder/Providers/Youtube/YouTubeVideoFrame.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@inject IJSRuntime JsRuntime | ||
@using Microsoft.JSInterop | ||
@implements IDisposable | ||
@implements IAsyncDisposable | ||
@inherits VideoFrame | ||
|
||
<div id="ytplayer" style="width: 100%; height: 80vh;"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters