如何通过entryid从kaltura获取文件URL

时间:2016-05-13 10:51:17

标签: java kaltura

我必须通过entryId将视频网址上​​传到kaltura。我见过kaltura api,但没有得到适当的解决方案。我在php代码中得到了一些东西:

 $ks = $client->session->start($secret, $userId, KalturaSessionType::ADMIN, $partnerId, 86400, 'disableentitlement');
$client->setKs($ks);

$client->startMultiRequest();
$entryId = '1_u7aj9kasw'; //replace this with your entry Id
$client->flavorAsset->getwebplayablebyentryid($entryId);
$req1ResultFlavorId = '{1:result:0:id}'; //get the first flavor from the result of getwebplayablebyentryid
$client->flavorAsset->geturl($req1ResultFlavorId); //this action will return a valid download URL
$multiRequestResults = $client->doMultiRequest();
$downloadUrl = $multiRequestResults[1];
echo 'The entry download URL is: '.$downloadUrl;

但我必须用java做,我尝试过:

KalturaConfiguration config = new KalturaConfiguration();
        config.setEndpoint(envConfiguration.getKalturaUrl());
        KalturaClient client = new KalturaClient(config);
        String ks = client.generateSession(envConfiguration.getKalturaSecretKey(), "TestUploader",
                KalturaSessionType.ADMIN, 101);
        client.setKs(ks);
        client.startMultiRequest();
        String url = client.getFlavorAssetService().getUrl("entryid");
        log.debug("url is::::::"+ url);

但我得到的网址为null。请帮助。 在此先感谢!!!

0 个答案:

没有答案