Brightcove4net - A .NET wrapper for the Brightcove Media API

  • David Mills
  • January 19, 2011

UPDATE 2011-02-18: Brightcove4net has been adopted by the Open Source @ Brightcove intiative as the featured .NET wrapper. The project has be renamed to BrightcoveOS .NET MAPI Wrapper, and has been migrated to the BrightcoveOS repository. Please go to the new repository for the latest updates: https://github.com/BrightcoveOS/.NET-MAPI-Wrapper

Introducing Brightcove4net

Brightcove4net is a .NET wrapper for the Brightcove Media API. All available API calls have been wrapped, for both video and audio. Get it here:

Download Brightcove4net

Quickstart

See Getting Started and Examples.

How do I use it?

It's easy! The following code will retrieve and process the first 100 videos in your account:

// Instantiate an API object by using the provided factory
BrightcoveApi api = BrightcoveApiFactory.CreateApi("my API read token");

// Retrieve up to the first 100 videos via the "find_all_videos" API call
BrightcoveItemCollection<BrightcoveVideo> videos = api.FindAllVideos();
foreach (BrightcoveVideo video in videos)
{
    // do something with each video
}

For more examples, head over to the project wiki.

Why Should You Choose Brightcove4net?

  • 100% API coverage. All API calls have been wrapped, including calls related to audio!
  • Permissive open source license. Brightcove4net is licensed under the MIT License, which means you can use it for commercial and proprietary projects without running afoul of the license terms, or being forced to open your own source code.
  • Easy to extend. Brightcove4net is written in a way that will be easy to extend in order to support any future additions to Brightcove’s Media API.
  • Convenient model objects allow a developer to easily read, modify, and write data and properties for Brightcove items, such as BrightcoveVideo, BrightcoveAudioTrack, BrightcovePlaylist, and more.
  • Robust API error detection. Brightcove4net will detect error messages returned by API calls, wrap them in a BrightcoveApiException, and throw the exception so that it can be handled via standard .NET try/catch blocks.

Why did we write Brightcove4net?

Here at Velir, we do a lot of integration with various 3rd party systems. Several of our clients are also customers of Brightcove, so we've had the need to work with the Brightcove's Media API on a few projects. Brightcove4net was written from scratch to enable our in-house .NET developers to quickly and easily integrate our clients' web applications with Brightcove's API.

We're very pleased that we can give back to the open source community by releasing Brightcove4net to the public.

Wasn't there already a .NET wrapper for Brightcove?

There are two other open source projects that wrap the Brightcove API in .NET code: Tanaris and sukiyoshi; but they are both based off the same codebase and share similar problems that make them ill-suited for Velir's needs:

  • Lack of support for certain API calls.
  • Complete lack of support for any API calls relating to audio tracks.
  • Both libraries are licensed under the GPLv3, which can be a cumbersome license depending on how you plan to use the libraries.
  • Both libraries are difficult to extend gracefully without making breaking changes. (e.g. JSON parsing is super wonky in Tanaris.)

So how do I get started with Brightcove4net?

Head over to the project wiki to download the dlls, read some docs, and see some examples.