Need help with sample code

RichardStarr
RichardStarr Los Angeles,CAMember Posts: 9

I'm using the c# api provided on this page.


Error CS0029 Cannot implicitly convert type 'Kaltura.Services.UploadTokenAddRequestBuilder' to 'Kaltura.Types.UploadToken'

and

Error CS0029 Cannot implicitly convert type 'Kaltura.Services.MediaAddContentRequestBuilder' to 'Kaltura.Types.MediaEntry'

---------------- code on page.

KalturaConfiguration config = new KalturaConfiguration(PARTNER_ID);
config.ServiceUrl = SERVICE_URL;
Client client = new Client(config);
client.KS = client.GenerateSession(ADMIN_SECRET, USER_ID, KalturaSessionType.ADMIN, PARTNER_ID, 86400, "");

Create a new Media Entry to which we’ll attach the uploaded file:

KalturaMediaEntry mediaEntry = new KalturaMediaEntry();
mediaEntry.Name = "Media Entry Using C#";
mediaEntry.MediaType = KalturaMediaType.VIDEO;
mediaEntry = client.MediaService.Add(mediaEntry);

Upload the media file:

FileStream fileStream = new FileStream("DemoVideo.flv", FileMode.Open, FileAccess.Read);
KalturaUploadToken uploadToken = client.UploadTokenService.Add();
client.UploadTokenService.Upload(uploadToken.Id, fileStream);

Attach the Media Entry to the file:

KalturaUploadedFileTokenResource mediaResource = new KalturaUploadedFileTokenResource();
mediaResource.Token = uploadToken.Id;
mediaEntry = client.MediaService.AddContent(mediaEntry.Id, mediaResource);

-------------

Code I've slightly modified to eliminate errors, except the last two.

      Kaltura.Configuration config = new Kaltura.Configuration();

      config.ServiceUrl = SERVICE_URL;

      Client client = new Client(config);

      client.KS = client.GenerateSession(PARTNER_ID, ADMIN_SECRET, USERID,SessionType.USER, 86400, "");

      MediaEntry mediaEntry = new MediaEntry();

      mediaEntry.Name = "Media Entry Using C#";

      mediaEntry.MediaType = MediaType.VIDEO;

      MediaService.Add(mediaEntry);

      FileStream fileStream = new FileStream("DemoVideo.flv", FileMode.Open, FileAccess.Read);

      UploadToken uploadToken = UploadTokenService.Add();

      UploadTokenService.Upload(uploadToken.Id, fileStream);     


      UploadedFileTokenResource mediaResource = new UploadedFileTokenResource();

      mediaResource.Token = uploadToken.Id;

      mediaEntry = MediaService.AddContent(mediaEntry.Id, mediaResource);

Answers

  • Dani
    Dani Northern California USAKalturian Posts: 242 admin

    @RichardStarr

    Have you opened a support ticket for this?

    Thanks!

    Dani

    Senior Director, Community

    *Click on a positive reaction if my reply was helpful

  • RichardStarr
    RichardStarr Los Angeles,CAMember Posts: 9

    No, I don't know how.

    The people I work for opened up an account so I can see the media files we've uploaded, but they never told me anything in regards of how to get tech support. I was given source code, but little else.

  • Dani
    Dani Northern California USAKalturian Posts: 242 admin

    Try here: https://support.kaltura.com/login

    Also have a look at the developer forum here.

    Dani

    Senior Director, Community

    *Click on a positive reaction if my reply was helpful

  • RichardStarr
    RichardStarr Los Angeles,CAMember Posts: 9

    Apparently my login does not work in that area.

    I'm accessing

    but I can't access the support login.

    Should I got to site.kaltura.com/request-portal-access

    Or ?

    Clicking on the developer forum link, then attempting to login results in a page

    "This site can't be reached. sso.kaltura.org took too long to respond."

  • Dani
    Dani Northern California USAKalturian Posts: 242 admin

    For support either request access or reach out to your Kaltura admin.

    Developer forum seems to be having some issues so hold for now.

    Dani

    Senior Director, Community

    *Click on a positive reaction if my reply was helpful

  • RichardStarr
    RichardStarr Los Angeles,CAMember Posts: 9

    Developer Forum was down last week too.

    I've put in a request via the web form for support access.

  • Dani
    Dani Northern California USAKalturian Posts: 242 admin

    I'll ping the team that owns the developer forum, thx!

    Dani

    Senior Director, Community

    *Click on a positive reaction if my reply was helpful

  • Dani
    Dani Northern California USAKalturian Posts: 242 admin

    @RichardStarr Developer forum login is back up again. https://forum.kaltura.org/

    Dani

    Senior Director, Community

    *Click on a positive reaction if my reply was helpful

  • RichardStarr
    RichardStarr Los Angeles,CAMember Posts: 9

    Login page is up, but not working for me.

    Still waiting on the registration request from earlier.

    That might be needed?

This Month's Leaders