Coder Social home page Coder Social logo

brightcoveos / .net-mapi-wrapper Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 29.0 20.79 MB

This project provides a starting point for integrating the Brightcove Media API into your application. It provides simple ways to interact with the API.

Home Page: http://opensource.brightcove.com/project/NET-MAPI-Wrapper

License: MIT License

C# 100.00%

.net-mapi-wrapper's People

Contributors

amhed avatar dmillz avatar mister-ben avatar vml-bramey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

.net-mapi-wrapper's Issues

Lower Memory Usage

To lower memory usage during the upload of large files I would add this setting to the BasicRequestBuilder:

request.AllowWriteStreamBuffering = false;

Setting that value uses less memory and large uploads are not stored in ram while being uploaded.

A connection attempt failed

Hi,
I'm having this issue trying to use the .NET-MAPI-Wrapper and im sure its something simple im missing but could you possibly point me in the correct direction?

Here is the error i get when running this code.

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

I'm just trying to use one of your examples but im trying to figure out if i missed a setting or soemthing?

long _id = MyworkVideoId;
BrightcoveApi api = BrightcoveApiFactory.CreateApi("MyWorkReadKey");
//messing with timeout here
api.Configuration.RequestTimeout = 999999999;
BrightcoveVideo video = api.FindVideoById(_id);

This should work correct?
Thank you,
Tom

FLVFullLength

This property does not seems to be supported in the object.

StartDate and EndDate null

Hey Dave, I was working on a project that was using start and end dates on the videos to determine what order the videos would be sorted by and realized that you had commented out the StartDate and EndDate values from the VideoFields enum. In my own project I included those values but was getting exceptions for the date strings that are passed into ConvertAndSetDate as being null. I'm not sure if you didn't want to include these for a specific reason so I figured I'd mention it in the event you do include them at a later date. I ended up setting the date to a default value if the dateString param is null. Also I'm not sure what the intended use is so it may be better to handle the exception but I don't think it would finish deserializing the rest of the videos if I were to do it that way. In my case the videos still display and it's up to the content authors to provide the correct date to display them in order.

lliseconds = long.Parse((string)dateString);
setterCallback(FromUnixMillisecondsUtc(milliseconds));
}

SearchText Returns no results

Hi,

I am searching for videos using search text and have a problem doing it in code. The following line works when I test this in a browser:
http://api.brightcove.com/services/library?command=search_videos&token=[MY_TOKEN]&tag=DMNews&any=search_text:Pat&exact=true

When I try to do the same thing in the code, I get 0 results in my list (C# code):

FieldValuePair searchTagPair = new FieldValuePair();
searchTagPair.Field = "tag";
searchTagPair.Value = "DMNews";

searchFieldList.Add(searchTagPair);

FieldValuePair searchTextPair = new FieldValuePair();
searchTextPair.Field = "search_text";
searchTextPair.Value = "Pat";

searchFieldList.Add(searchTextPair);

this.videos = this.api.SearchVideos(null, searchFieldList, null, 20, 0, true);
this.BindRepeater();

Any idea what I am doing wrong?

CustomFields Count is coming always zero for me even custom fields exists in my account.

Hi, I have used below code to get custom field value as per David instructions

BrightcoveVideo videosd = api.FindVideoById(video.Id, null, new[] {"myFieldName"});
string customFieldValue = videosd.CustomFields["myFieldName"];

But CustomFields count is coming zero and giving error while retrieving 'myFieldName' field value that "The given key was not present in the dictionary.". But I have cross checked in my video cloud account as well, 'myFieldName' field exists and having value as well.

Thanks and regards,
Raghav

BrightCoveRendition read only fields

Hi,

I'm attempting to write MetaData and noticed some Brightcove rendition fields are read-only while in the api docs they are write-able.

Specifically EncodingRate, FrameHeight, and FrameWidth:

http://support.brightcove.com/en/video-cloud/docs/creating-videos-remote-assets-using-media-api

frameHeight: Required for multiple renditions: The height of the image in pixels.
frameWidth: Required for multiple renditions: The width of the image in pixels.
encodingRate: Required for multiple renditions: For multi-bitrate streaming renditions, the encoding rate in bits per second. For example, 150 kbps is specified as 150000.
If you do not supply a value for the encoding rate, the encodingRate property for the video will be returned as 0.

Is there a way to change this?

Best,
Rob

StartDate not returned

Hi, Using the .net wrapper we noticed that the start date is not returned, for all videos it returns
"12:00 AM" The other dates seem to be fine, Is it possible to get this date field corrected. Thanks.

SortOrder.Ascending returning same result set as SortOrder.Descending

Hello,

It's me again - hopefully this time it's actually a bug and not a problem on my end.

I'm finding that when I toggle between Ascending and Descending for the sort order, I am getting the same result set.

Here is some sample of the code I have written

currentSortOrder = SortOrder.Ascending;
videos = api.SearchVideos(keywordSearchItems, null, null, 100, page, true, currentSortCriteria,
                    currentSortOrder, null, new[] { "status", "products=\"FAS\"", "business_solution" }, true);

This also involves another question I have. Using the brightcove url it's possible to do customFields:searchTerm and it will search all of the custom fields for that search term. Is it possible to do something similar using the API? I was trying to emulate the behavior with the products="FAS" but I haven't seen a change in the results set since adding the ="FAS" either which I find surprising.

One last thing: I'm still getting an error thrown when using SortBy.None. Is there no way to just use the default sorting instead of the other provided values? And is there no way to sort by title?

Any help would be greatly appreciated :)

  • Charles

BrightcoveMapiWrapper.Api.BrightcoveApi.SearchVideos encodes values incorrectly

Call stack:

Api.BrightcoveApi.SearchVideos
-> Api.BrightcoveApi.RunQuery
-> Api.Connectors.BrightcoveApiConnecter.GetResponseJson
-> Util.Extensions.CollectionExtensions.ToQueryString

In ToQueryString, each list of params in "all", "any", and "none" are split and encoded using HttpUtility.UrlEncode(s)

Looking at the query string generated from this, a parameter like "tag:tagname" gets encoded to "tag%3Atagname". Sending this query parameter to Brightcove results in no results.

Instead, if we use UrlPathEncode(s), we will correctly encode "tag:tagname" to "tag:tagname" and get results as expected.

I can make this change if that's okay, but not sure about what tests to run to verify it doesn't break any existing behaviour.

Thanks,
Bhaskar

enumeration value cannot be 'none' when deserializing rendition - controllerType

We are trying to call UpdateVideo and are passing a BrightcoveVideo instance with a Renditions[] ControllerType of None and are catching an error that states "enumeration value cannot be "None."

Prior to updating the video, the endpoint call at (http://api.brightcove.com/services/library?command=find_video_by_id&token=18_XyZsvuTpld39gZIpUnA4qWDKTOqufQF6udYCcWTK4XK6M65xbDg..&video_id=3884237850001) returns a rendition value - controllerType as "AKAMAI_HD2" which does not appear to exist in your source code. Can this value be added to your Brightcove MAPI Wrapper for .NET?

More details

renditions: [
{
audioOnly: false,
controllerType: "AKAMAI_HD2", ///This is the value that is causing the issue
displayName: null,
encodingRate: 1000,
frameHeight: 0,
frameWidth: 0,
id: 3712184996001,
referenceId: "VPC-Live-2B_HDS",
remoteStreamName: null,
remoteUrl: "http://gvpc-f.akamaihd.net/z/VPC_2B_1@112069/manifest.f4m",
size: 500,
uploadTimestampMillis: 1407169135008,
url: "http://gvpc-f.akamaihd.net/z/VPC_2B_1@112069/manifest.f4m",
videoCodec: "H264",
videoContainer: "MP4",
videoDuration: -1
}
],

Thank you,

FieldValuePair needs to be marked serializable

Dave,
Can you please mark this serializable? So I can store my search criteria that consists of a list of in the viewstate across paging postbacks.

Type 'BrightcoveMapiWrapper.Model.Containers.FieldValuePair' in Assembly 'BrightcoveOS.NET-MAPI-Wrapper, Version=1.0.4190.30038, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

Thanks,
Boris

P.S. this.videos = (BrightcoveItemCollection)this.videos.Skip(this.SelectedPageIndex*pageSize).Take(pageSize);

The above line throws an error...something to do with the iterator not being able to index the collection properly.....

How to upload video of large size like 500mb or more?

How to upload video of large size like 500mb or more using same .NET-Mapi-Wrapper ?
Stream is giving out of memory issue for large videos.

Is there workaround someone has already done related to this?

Best regards,
Raghav

How to set ReadWriteTimeout property of Httpwebrequest in this Wrapper?

HI,

    i have more than 1000 videos,when request at some point timeout exception appears. It can be resolved if ReadWriteTimeout property of Httpwebrequest object is set. I ididn't get any property from wrapper. Please advice.

public static IEnumerable AllVideosInAccount()
{
BrightcoveApi api = BrightcoveApiFactory.CreateApi(token);

        // start on the first page
        int page = 0;
        BrightcoveItemCollection<BrightcoveVideo> videos = api.FindAllVideos(100, page);
        while (videos.Count > 0)
        {
            foreach (BrightcoveVideo video in videos)
            {
                // The "yield return" statement allows us defer execution of the next page of 
                // results until after all the videos on the current page have been processed.
                yield return video;
            }

            // next page
            page++;
            videos = api.FindAllVideos(100, page);
        }
    }

Thanks,
Uday

How to Sync BrightCove Video metadata to our local Database?

Hi,

i need to work on sync functionality from BrightCove Video metadata to our local Database whenever we add, update or delete metadata such as title, descriptions or tags in Video Cloud media library, these changes should automatically sync with the equivalent metadata for our assets on Database using the above BrightCoveAPIWrapper.

Please suggest.

Thanks,
Uday

BrightcoveAPI.video.read.cs custom fields

The add custom fields isn't passing the custom fields object. It's passing the video fields object.

line 43.

if (customFields != null)
{
parms.AddRange("custom_fields", videoFields);
}

Same results regardless of videoFields value.

I've tried a few different combinations but always get the same results. In my brightcove Library, there are 8 videos that have a custom field "products" of value "FAS". I know this because I tried manually sort ing through all of the videos returned from a FindAllVideos. When performing search for the word "FAS" though I only get 4 results regardless of what I set in my videoFields.

videos = api.SearchVideos(keywordSearchItems, null, null, 100, page, true, currentSortCriteria,
                    currentSortOrder, new[] { "customFields" }, new[] { "status", "products", "business_solution" }, true);

returns the exact same as

videos = api.SearchVideos(keywordSearchItems, null, null, 100, page, true, currentSortCriteria,
                    currentSortOrder, new[] { "shortDescription", "customFields" }, new[] { "status", "products", "business_solution" }, true);

It also returns the same as if the videoField was null. Just in case, I already tried with the customFields being null and got the same results.

I don't understand why this is the case, as this part of the code is pretty straightforward (requestParams.ToQueryString(). I'm planning on doing some more digging and will update if I find anything.

Please let me know if it's something I'm doing wrong though!

Adding GeoRestricted video field doesn't work for some reason

Hi,

I was trying to add the following fields so I can get the value from API, but it just give me the values 'undefined'. I'm not sure what I did wrong, can you give some advice please?

GeoRestricted/geoRestricted
GeoFilteredCountries/geoFilteredCountries
GeoFilterExclude/geoFilterExclude

Best Regards,
Ray

Issue with large size(>149MB) video file in api.CreateVideo

Hi Team,
I am trying to upload video file greater than 149 MB at that time i am getting exception from api.CreateVideo method as:

Message: The request was aborted: The request was canceled.
Inner exception: Cannot close stream until all bytes are written.
Stack trace:

HResult -2146232800 int
at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)

at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)
at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState)
at System.Net.ConnectStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at BrightcoveMapiWrapper.Api.Connectors.BasicRequestBuilder.WriteMultipartFormData(HttpWebRequest request, NameValueCollection postParameters, FileUploadInfo fileToUpload, String boundary)
at BrightcoveMapiWrapper.Api.Connectors.BasicRequestBuilder.BuildMultipartFormDataPostRequest(String postUrl, NameValueCollection postParameters, FileUploadInfo fileToUpload)
at BrightcoveMapiWrapper.Api.Connectors.BrightcoveApiConnector.GetPostResponseJson(String postJson, FileUploadInfo fileUploadInfo)
at BrightcoveMapiWrapper.Api.Connectors.BrightcoveApiConnector.GetFilePostResponseJson(String postJson, FileUploadInfo fileUploadInfo)
at BrightcoveMapiWrapper.Api.BrightcoveApi.RunFilePost[T](BrightcoveParamCollection postParams, FileUploadInfo fileToUpload)
at BrightcoveMapiWrapper.Api.BrightcoveApi.CreateVideo(BrightcoveVideo video, FileUploadInfo fileUploadInfo, EncodeTo encodeTo, Boolean createMultipleRenditions, Boolean preserveSourceRendition, Boolean h264NoProcessing)
at BrightcoveMapiWrapper.Api.BrightcoveApi.CreateVideo(BrightcoveVideo video, String fileToUpload, EncodeTo encodeTo, Boolean createMultipleRenditions, Boolean preserveSourceRendition, Boolean h264NoProcessing)

Please let me know, any pointers to resolve above mentioned issue.

Incorrect error regarding enumeration value of "None"

I grabbed this line of code from one of your examples:

BrightcoveItemCollection<BrightcoveVideo> videos = api.FindAllVideos(10, 0, SortBy.PlaysTotal, SortOrder.Descending);

I get the following error:

enumeration value cannot be 'None'
at BrightcoveMapiWrapper.Util.Extensions.EnumExtensions.ToBrightcoveName[T](T enumeration)
...

Does this mean that the FindAllVideos method is broken until further notice? I'd like to use your library but if this functionality doesn't work I'll have to switch over to JSON parsing given my time constraints (ew) so any help is greatly appreciated :)

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.