Xam.Android.LiTr 1.5.1

dotnet add package Xam.Android.LiTr --version 1.5.1
NuGet\Install-Package Xam.Android.LiTr -Version 1.5.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xam.Android.LiTr" Version="1.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xam.Android.LiTr --version 1.5.1
#r "nuget: Xam.Android.LiTr, 1.5.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xam.Android.LiTr as a Cake Addin
#addin nuget:?package=Xam.Android.LiTr&version=1.5.1

// Install Xam.Android.LiTr as a Cake Tool
#tool nuget:?package=Xam.Android.LiTr&version=1.5.1

Xam.Android.LiTr

Xamarin.Android Binding of linkedin.LiTr library https://github.com/linkedin/LiTr by Giuseppe Novielli

LiTr v1.5.1

Documentation Available https://github.com/linkedin/LiTr

How To use

  1. Add nuget package https://www.nuget.org/packages/Xam.Android.LiTr/
  2. Copy and paste follow code
  3. Compile <> tag
var name = <name_video>.mp4
var fileOutputPath = System.IO.Path.Combine(Android.App.Application.Context.GetExternalFilesDir(Android.OS.Environment.DirectoryMovies).AbsolutePath, name);

var videoFormat = MediaFormat.CreateVideoFormat(MediaFormat.MimetypeVideoAvc, <width>, <height>);
videoFormat.SetInteger(MediaFormat.KeyBitRate, <bitrate>);
videoFormat.SetInteger(MediaFormat.KeyFrameRate, <framerate>);
videoFormat.SetInteger(MediaFormat.KeyIFrameInterval, <iframeinterval>);

var audioFormat = MediaFormat.CreateAudioFormat(MediaFormat.MimetypeAudioAac, 44100, 2);
audioFormat.SetInteger(MediaFormat.KeyBitRate, 128000);

var UUID = Guid.NewGuid().ToString();

var mediaTransformer = new MediaTransformer(context);
var listener = new TransformationListener();
mediaTransformer.Transform(
               UUID,
               <inputUri>,
               fileOutputPath,
               videoFormat,
               audioFormat,
               listener,
               null);

public class TransformationListener : Java.Lang.Object, ITransformationListener
{
    public TransformationListener()
    {
    }

    public void OnCancelled(string id, IList<TrackTransformationInfo> trackTransformationInfos)
    {
        System.Diagnostics.Debug.WriteLine("\n\n");
        System.Diagnostics.Debug.WriteLine("OnCancelled");
        System.Diagnostics.Debug.WriteLine(id);
    }

    public async void OnCompleted(string id, IList<TrackTransformationInfo> trackTransformationInfos)
    {
        System.Diagnostics.Debug.WriteLine("\n\n");
        System.Diagnostics.Debug.WriteLine("OnCompleted");
        System.Diagnostics.Debug.WriteLine(id);
    }

    public void OnError(string id, Java.Lang.Throwable cause, IList<TrackTransformationInfo> trackTransformationInfos)
    {
        System.Diagnostics.Debug.WriteLine("\n\n");
        System.Diagnostics.Debug.WriteLine("OnError");
        System.Diagnostics.Debug.WriteLine(id);
        System.Diagnostics.Debug.WriteLine(cause.ToString());
    }

    public void OnProgress(string id, float progress)
    {
        System.Diagnostics.Debug.WriteLine("\n\n");
        System.Diagnostics.Debug.WriteLine("OnProgress");
        System.Diagnostics.Debug.WriteLine(id);
        System.Diagnostics.Debug.WriteLine(progress.ToString());
    }

    public void OnStarted(string id)
    {
        System.Diagnostics.Debug.WriteLine("\n\n");
        System.Diagnostics.Debug.WriteLine("OnStarted");
        System.Diagnostics.Debug.WriteLine(id);
    }
}              
Product Versions
MonoAndroid monoandroid11
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.1 230 5/28/2022
1.5.0 238 4/3/2022

Sync Version to original library 1.5.1