ISchemm.DurationFinder
5.0.0
dotnet add package ISchemm.DurationFinder --version 5.0.0
NuGet\Install-Package ISchemm.DurationFinder -Version 5.0.0
<PackageReference Include="ISchemm.DurationFinder" Version="5.0.0" />
paket add ISchemm.DurationFinder --version 5.0.0
#r "nuget: ISchemm.DurationFinder, 5.0.0"
// Install ISchemm.DurationFinder as a Cake Addin #addin nuget:?package=ISchemm.DurationFinder&version=5.0.0 // Install ISchemm.DurationFinder as a Cake Tool #tool nuget:?package=ISchemm.DurationFinder&version=5.0.0
ISchemm.DurationFinder
This library will attempt detect the duration of a video, given a URL that
points to either a raw video resource (that you might put in a <video>
tag)
or a supported video-sharing site.
Providers
- SchemaOrgDurationProvider (for pages with a
<meta itemprop="duration">
tag) - OpenGraphDurationProvider (for pages with a
<meta property="og:video:duration">
or<meta property="video:duration">
tag) - OEmbedDurationProvider (for pages that provide oEmbed discovery through a
<link>
element to a JSON endpoint which contains a non-standardduration
property) - HlsDurationProvider (for HLS VOD playlists)
- MP4DurationProvider (for MPEG-4 Part 14 containers, such as .mp4 and .m4a - requires HTTP range request support on the remote server)
- VorbisDurationProvider (for Ogg containers - requires HTTP range request support on the remote server, and the file must contains a Vorbis stream)
Additional providers that are not included in Providers.All
but are used internally:
- ChunklistDurationProvider (for HLS VOD chunklists)
- JsonDurationProvider (for JSON files with a numeric
duration
property)
Support
- YouTube (SchemaOrgDurationProvider)
- SoundCloud (SchemaOrgDurationProvider)
- Vimeo (OEmbedDurationProvider)
- HLS (HlsDurationProvider)
- .mp4 (MP4DurationProvider)
- .m4a (MP4DurationProvider)
- .ogg (VorbisDurationProvider)
- .oga (VorbisDurationProvider)
- .ogv (VorbisDurationProvider)
Twitch might also work with OpenGraphDurationProvider, but this can be hit and miss.
Usage
- Use
ChainedDurationProvider
to combine multiple providers (or just use the static objectProviders.All
) - Call the extension function
GetDurationAsync(Uri)
on the resulting provider object
Each provider will check the content type of the GET response, and only
download what data is necessary. The first provider to come up with a valid
duration value will be used, and any remaining providers will be skipped. If
none of the providers come up with a result, GetDurationAsync(Uri)
will
check for a <link rel="canonical">
tag and try again (provided that the URL
in the tag has not been attempted yet).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- HtmlAgilityPack (>= 1.11.65)
- ISchemm.MP4Support (>= 1.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 8.0.4)
-
net8.0
- HtmlAgilityPack (>= 1.11.65)
- ISchemm.MP4Support (>= 1.0.0)
- System.Text.Json (>= 8.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ISchemm.DurationFinder:
Package | Downloads |
---|---|
DurationHelper
A .NET library to get duration of a video from its URL. Supports MP4, HLS (VOD), YouTube and Twitch (if you provide API keys), Vimeo, Dailymotion, and SoundCloud. |
GitHub repositories
This package is not used by any popular GitHub repositories.