Hi,
We recently migrated all our content from Ooyala to JWPlayer Hosted Platform. We needed a .NET tool to perform the following:
- Create Videos from remote sources
- Update Videos later e.g. Thumbnails etc
- List Videos in a Custom Application
- Other cools ideas that come in after adopting a new tool
Currently JWPlayer Management API only has a PHP and Python 2.7 Client as examples for Batch Migration.
To use in Visual Studio:
- Open Package Manager Console
- Run – Install-Package JWPlayer.NET
I have created an Open Source JWPlayer.NET library. Please feel free to improve on it e.g. Make it fluent.
Get Source Code (JWPlayer.NET)
Below is how you can use the API as at 29/06/2017.
Create Video
var jw = new Jw(ApiKey, ApiSecret); var parameters = new Dictionary<string, string> { {"sourceurl", "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4"}, {"sourceformat", "mp4"}, {"sourcetype", "url"}, {"title", "Test"}, {"description", "Test Video"}, {"tags", "foo, bar"}, {"custom.LegacyId", Guid.NewGuid().ToString()} }; var result = jw.CreateVideo(parameters);
Update Video
var jw = new Jw(ApiKey, ApiSecret); var parameters = new Dictionary<string, string> { {"video_key", "QxbbRMMP"}, {"title", "Test Updated"}, {"tags", "foo, bar, updated"}, }; var result = jw.UpdateVideo(parameters);
List Video
var jw = new Jw(ApiKey, ApiSecret); var basicVideoSearch = new BasicVideoSearch {Search = "Foo", StartDate = DateTime.UtcNow.AddDays(-100)}; var result = jw.ListVideos(basicVideoSearch); var count = result.Videos.Count;
Batch Migrations
Ensure you stick to the Rate Limit of 60 calls per minute, or call your JWPlayer Account Manager to increase it.
for(var i = 0; i < lines.count; i++) { jw.CreateVideo(parameters); Thread.Sleep(TimeSpan.FromSeconds(1)); }