Skip to content

Commit

Permalink
Removing non used methods.
Browse files Browse the repository at this point in the history
Removing Azure Media Player.
Removing direct cals to Azuree Video Indexer configuration in order to use information from data.
  • Loading branch information
efonsecab committed Apr 18, 2024
1 parent 93d7675 commit 374e01a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 70 deletions.
4 changes: 0 additions & 4 deletions src/FairPlayCombinedSln/FairPlayTube/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
<link rel="stylesheet" href="custom.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.min.css">
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="//amp.azure.net/libs/amp/2.3.11/skins/amp-default/azuremediaplayer.min.css">
<script src="//amp.azure.net/libs/amp/2.3.11/azuremediaplayer.min.js"></script>

<script src="scripts/azure-media-player.js"></script>

<!--Paypal-->
<script src="@payPalScriptSrc" data-sdk-integration-source="button-factory"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@rendermode RenderMode.InteractiveServer
@inject IJSRuntime jsRuntime
@inject AzureVideoIndexerService azureVideoIndexerService
@inject VideoInfoService videoInfoService
@inject IUserProviderService userProviderService
@inject NavigationManager navigationManager
Expand Down Expand Up @@ -107,35 +106,6 @@
this.IsBusy = false;
}

private async Task OnPlayVideoClickedAsync(string videoId)
{
this.IsBusy = true;
StateHasChanged();
var armAccessToken = await azureVideoIndexerService.AuthenticateToAzureArmAsync();
var viAccessTokenResponse = await azureVideoIndexerService
.GetAccessTokenForArmAccountAsync(armAccessToken, CancellationToken.None);
var videoIndex = await azureVideoIndexerService
.GetVideoIndexAsync(videoId, viAccessTokenResponse!.AccessToken!,
CancellationToken.None);
var supportedLanguages = await azureVideoIndexerService
.GetSupportedLanguagesAsync(viAccessTokenResponse!.AccessToken!,
this.cancellationTokenSource.Token);
var singleVideoIndex = videoIndex!.videos!.Single();
await jsRuntime.InvokeVoidAsync("initSource", $"vid-{videoId}",
singleVideoIndex.publishedUrl,
singleVideoIndex.viewToken,
videoId,
supportedLanguages!.Select(p => new
{
src = $"/api/video/{videoId}/captions/{p.languageCode}",
srclang = p.languageCode,
kind = "subtitles",
label = p.name
}).OrderBy(p => p.label).ToArray());
this.IsBusy = false;
StateHasChanged();
}

private void OnViewMyVideoViewersClicked(VideoInfoModel videoInfoModel)
{
this.navigationManager.NavigateTo($"{Constants.Routes.FairPlayTubeRoutes.CreatorRoutes.MyVideoViewers}/{videoInfoModel.VideoId}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@implements IAsyncDisposable
@using FairPlayCombined.Interfaces
@using FairPlayCombined.Models.AzureVideoIndexer
@using FairPlayCombined.Models.FairPlayTube.VideoInfo
@using FairPlayCombined.Services.Common
@using FairPlayCombined.Services.FairPlayTube
@using FairPlayTube.Components.Spinners
Expand All @@ -14,7 +15,6 @@
@inject IUserProviderService userProviderService
@inject SupportedLanguageService supportedLanguageService
@inject VideoInfoService videoInfoService
@inject AzureVideoIndexerServiceConfiguration azureVideoIndexerServiceConfiguration

<FluentLabel Typo="Typography.H3">WatchVideo</FluentLabel>

Expand Down Expand Up @@ -57,6 +57,7 @@ else
private CancellationTokenSource cancellationTokenSource = new();
private bool UseFallbackMode { get; set; }
private string? FallbackModeUrl { get; set; }
private VideoInfoModel? videoInfoModel { get; set; }
private string? VideoUrl { get; set; }
private SupportedLanguageModel[]? SupportedLanguages { get; set; }
private DotNetObjectReference<WatchVideo>? dotNetObjectReference;
Expand All @@ -72,11 +73,11 @@ else
{
this.IsBusy = true;
StateHasChanged();
var videoInfo = await this.videoInfoService.GetVideoInfoByVideoIdAsync(
this.videoInfoModel = await this.videoInfoService.GetVideoInfoByVideoIdAsync(
this.VideoId!,
this.cancellationTokenSource.Token
);
this.VideoUrl = videoInfo!.PublishedUrl;
this.VideoUrl = videoInfoModel!.PublishedUrl;
this.SupportedLanguages = await supportedLanguageService
.GetAllSupportedLanguageAsync(this.cancellationTokenSource.Token);
StateHasChanged();
Expand Down Expand Up @@ -125,7 +126,7 @@ else

private void OnUseFallbackMode()
{
this.FallbackModeUrl = $"https://www.videoindexer.ai/embed/player/{this.azureVideoIndexerServiceConfiguration.AccountId}/{this.VideoId}/?locale=en&location={azureVideoIndexerServiceConfiguration.Location}";
this.FallbackModeUrl = $"https://www.videoindexer.ai/embed/player/{this.videoInfoModel!.AccountId}/{this.VideoId}/?locale=en&location={this.videoInfoModel.Location}";
this.UseFallbackMode = true;
StateHasChanged();
}
Expand Down

This file was deleted.

0 comments on commit 374e01a

Please sign in to comment.