Quantcast
Channel: Kaltura - Latest topics
Viewing all articles
Browse latest Browse all 2994

thumbAsset.setContent throws an error

$
0
0

@abrar wrote:

Hello, I am trying to update the content of thumbAsset

public updateThumbnailImage(thumbAssetId, fileData: File) {
    this.getClient().then((client: KalturaClient) => {
        const uploadAction = new UploadUploadAction({
            fileData: fileData
        } as UploadUploadActionArgs);

        client.request(uploadAction).subscribe((token: string) => {
            const uploadedFileTokenResource = new KalturaUploadedFileTokenResource({
                token: token
            } as KalturaUploadedFileTokenResourceArgs)

            const assetResource = new KalturaAssetResource({
                assetId: thumbAssetId,
                uploadedFileTokenResource
            } as KalturaAssetResourceArgs)

            const updateContentAction = new ThumbAssetSetContentAction({
                id: thumbAssetId,
                contentResource: assetResource,
            } as ThumbAssetSetContentActionArgs);

            client.request(updateContentAction).subscribe((thumb: KalturaThumbAsset) => {
                console.log('Updated thumb', thumb);
            });
        });
    });
}

I am setting KalturaAssetResource to ThumbAssetSetContentAction.contentResurce which throws this error

[KalturaFrontController->getExceptionObject] ERR: exception ‘KalturaAPIException’ with message ‘File doesnt exist’ in /opt/kaltura/app/api_v3/lib/types/resource/KalturaAssetResource.php:40

If i set KalturaContentResource to ThumbAssetSetContentAction.contentResurce according to the documentation then i get this error

[KalturaFrontController->getExceptionObject] ERR: exception ‘KalturaAPIException’ with message ‘The object type “KalturaContentResource” is abstract, use one of the object implementations’ in /opt/kaltura/app/api_v3/lib/KalturaRequestDeserializer.php:281

KalturaContentResource is indeed an abstract class

I checked the permissions on tmp folder, all is ok. I even set it to 777 just in case.

Please let me know if it is the correct way, BTW i can upload new thumbnails just fine.

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 2994

Trending Articles