Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
## Version 2.0.0 - October 31, 2019

  - **Added:** .NET Standard 2.0 DLL/nuget target is now available. This DLL can be used with ASP.NET Core 2.0+ web applications
    and .NET Core 2.0+ console/desktop applications. This means you can now use it with "ASP.NET Core on .NET Core" projects in
    addition to "ASP.NET Core on .NET Framework" which was already supported.

  - **Added:** Example project AspNetCoreCS in addition to AspNetCoreOnNetFullCS.

  - **Changed:** License keys are changed so please go to https://www.gleamtech.com/upgrade and acquire a new license key
    if you want to use this version (or higher). If your one year maintenance has not ended, you will receive a new free
    license key on the same page.
  • Loading branch information
GleamTech committed Oct 31, 2019
1 parent 3f7c2b7 commit a8984f9
Show file tree
Hide file tree
Showing 180 changed files with 1,192 additions and 408 deletions.
38 changes: 0 additions & 38 deletions Examples/AspNetCore.CS/AspNetCore.CS.csproj

This file was deleted.

25 changes: 25 additions & 0 deletions Examples/AspNetCoreCS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.9.28307.812
MinimumVisualStudioVersion = 15.0.26730.3
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCoreCS", "AspNetCoreCS\AspNetCoreCS.csproj", "{FDA0E92D-1D0D-4EC2-AA71-7D9D037A7C01}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FDA0E92D-1D0D-4EC2-AA71-7D9D037A7C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDA0E92D-1D0D-4EC2-AA71-7D9D037A7C01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDA0E92D-1D0D-4EC2-AA71-7D9D037A7C01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDA0E92D-1D0D-4EC2-AA71-7D9D037A7C01}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C9C2EE7-00E5-4E2D-8AF2-B134E683EC2E}
EndGlobalSection
EndGlobal
33 changes: 33 additions & 0 deletions Examples/AspNetCoreCS/AspNetCoreCS.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>GleamTech.VideoUltimateExamples.AspNetCoreCS</AssemblyName>
<RootNamespace>GleamTech.VideoUltimateExamples.AspNetCoreCS</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GleamTech.Core" Version="4.0.0" />
<PackageReference Include="VideoUltimate" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common">
<Version>4.5.1</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
<_CustomFiles Include="Controllers\**\*" />
<_CustomFiles Include="Views\**\*" />
<_CustomFiles Include="Descriptions\**\*" />
<DotnetPublishFiles Include="@(_CustomFiles)">
<DestinationRelativePath>%(Identity)</DestinationRelativePath>
</DotnetPublishFiles>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using GleamTech.Examples;
using GleamTech.IO;
using GleamTech.VideoUltimate;
using GleamTech.VideoUltimateExamples.AspNetCore.CS.Models;
using GleamTech.VideoUltimateExamples.AspNetCoreCS.Models;
using Microsoft.AspNetCore.Mvc;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Controllers
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Controllers
{
public partial class HomeController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using GleamTech.AspNet;
using GleamTech.Examples;
using GleamTech.VideoUltimate;
using GleamTech.VideoUltimateExamples.AspNetCore.CS.Models;
using GleamTech.VideoUltimateExamples.AspNetCoreCS.Models;
using Microsoft.AspNetCore.Mvc;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Controllers
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Controllers
{
public partial class HomeController
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Controllers
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Controllers
{
public partial class HomeController : Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GleamTech.Examples;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Models
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Models
{
public class OverviewViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GleamTech.AspNet;
using GleamTech.Examples;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Models
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Models
{
public class ReadingViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS.Models
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS.Models
{
public class VideoInfoModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS
{
public class Program
{
Expand Down
27 changes: 27 additions & 0 deletions Examples/AspNetCoreCS/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:65302/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"AspNetCoreCS": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:54486/"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
using System.IO;
using GleamTech.AspNet;
using GleamTech.AspNet.Core;
using GleamTech.VideoUltimate;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using GleamTech.AspNet;
using GleamTech.AspNet.Core;
using GleamTech.VideoUltimate;

namespace GleamTech.VideoUltimateExamples.AspNetCore.CS
namespace GleamTech.VideoUltimateExamples.AspNetCoreCS
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
Expand All @@ -31,13 +23,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}

app.UseGleamTech();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using GleamTech.AspNet.Core
@using GleamTech.Examples
@using GleamTech.VideoUltimateExamples.AspNetCore.CS.Models
@model GleamTech.VideoUltimateExamples.AspNetCore.CS.Models.OverviewViewModel
@using GleamTech.VideoUltimateExamples.AspNetCoreCS.Models
@model GleamTech.VideoUltimateExamples.AspNetCoreCS.Models.OverviewViewModel

<!DOCTYPE html>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using GleamTech.AspNet
@using GleamTech.AspNet.Core
@using GleamTech.VideoUltimateExamples.AspNetCore.CS.Models
@model GleamTech.VideoUltimateExamples.AspNetCore.CS.Models.ReadingViewModel
@using GleamTech.VideoUltimateExamples.AspNetCoreCS.Models
@model GleamTech.VideoUltimateExamples.AspNetCoreCS.Models.ReadingViewModel

<!DOCTYPE html>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2000
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.CS", "AspNetCore.CS\AspNetCore.CS.csproj", "{2AD943F9-8CEA-402A-AE92-16E007AC2166}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCoreOnNetFullCS", "AspNetCoreOnNetFullCS\AspNetCoreOnNetFullCS.csproj", "{2AD943F9-8CEA-402A-AE92-16E007AC2166}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
30 changes: 30 additions & 0 deletions Examples/AspNetCoreOnNetFullCS/AspNetCoreOnNetFullCS.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<AssemblyName>GleamTech.VideoUltimateExamples.AspNetCoreOnNetFullCS</AssemblyName>
<RootNamespace>GleamTech.VideoUltimateExamples.AspNetCoreOnNetFullCS</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GleamTech.Core" Version="4.0.0" />
<PackageReference Include="VideoUltimate" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<_CustomFiles Include="Controllers\**\*" />
<_CustomFiles Include="Views\**\*" />
<_CustomFiles Include="Descriptions\**\*" />
<DotnetPublishFiles Include="@(_CustomFiles)">
<DestinationRelativePath>%(Identity)</DestinationRelativePath>
</DotnetPublishFiles>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using GleamTech.AspNet;
using GleamTech.Caching;
using GleamTech.Examples;
using GleamTech.IO;
using GleamTech.VideoUltimate;
using GleamTech.VideoUltimateExamples.AspNetCoreOnNetFullCS.Models;
using Microsoft.AspNetCore.Mvc;

namespace GleamTech.VideoUltimateExamples.AspNetCoreOnNetFullCS.Controllers
{
public partial class HomeController
{
private static readonly ForwardSlashPath ThumbnailCachePath = "~/App_Data/ThumbnailCache";
private static readonly FileCache ThumbnailCache = new FileCache(ThumbnailCachePath.ToString());

private static void GetAndSaveThumbnail(string videoPath, Stream thumbnailStream)
{
using (var videoThumbnailer = new VideoThumbnailer(videoPath))
using (var thumbnail = videoThumbnailer.GenerateThumbnail(300))
thumbnail.Save(thumbnailStream, ImageFormat.Jpeg);
}

private static VideoInfoModel GetVideoInfo(string videoPath)
{
var model = new VideoInfoModel();

using (var videoFrameReader = new VideoFrameReader(videoPath))
{
model.Properties.Add("Duration", videoFrameReader.Duration.ToString());
model.Properties.Add("Width", videoFrameReader.Width.ToString());
model.Properties.Add("Height", videoFrameReader.Height.ToString());
model.Properties.Add("CodecName", videoFrameReader.CodecName);
model.Properties.Add("CodecDescription", videoFrameReader.CodecDescription);
model.Properties.Add("CodecTag", videoFrameReader.CodecTag);
model.Properties.Add("BitRate", videoFrameReader.BitRate.ToString());
model.Properties.Add("FrameRate", videoFrameReader.FrameRate.ToString(CultureInfo.InvariantCulture));

foreach (var entry in videoFrameReader.Metadata)
model.Metadata.Add(entry.Key, entry.Value);

if (model.Metadata.Count == 0)
model.Metadata.Add("", "");
}

return model;
}

public IActionResult Overview()
{
var model = new OverviewViewModel
{
ExampleFileSelector = new ExampleFileSelector
{
Id = "exampleFileSelector",
InitialFile = "MP4 Video.mp4"
}
};

var videoPath = model.ExampleFileSelector.SelectedFile;
var fileInfo = new FileInfo(videoPath);
var thumbnailCacheKey = new FileCacheKey(new FileCacheSourceKey(fileInfo.Name, fileInfo.Length, fileInfo.LastWriteTimeUtc), "jpg");
var cacheItem = ThumbnailCache.GetOrAdd(
thumbnailCacheKey,
thumbnailStream => GetAndSaveThumbnail(videoPath, thumbnailStream)
);

model.ThumbnailUrl = ExamplesConfiguration.GetDownloadUrl(
Hosting.ResolvePhysicalPath(ThumbnailCachePath.Append(cacheItem.RelativeName)),
thumbnailCacheKey.FullValue
);

model.VideoInfo = GetVideoInfo(videoPath);

return View(model);
}
}
}
Loading

0 comments on commit a8984f9

Please sign in to comment.