コード例 #1
0
ファイル: rats_api__transc.php プロジェクト: vwflow/raws-php
# See the License for the specific language governing permissions and
# limitations under the License.
# To run this sample, define these variables first
define('USER', "xxx");
# name of your Rambla user account
define('PWD', "xxx");
# password of your Rambla user account
define('DOWNLOAD_PATH', '/path/to/local/download/location');
# path to a file in which to store the transcoded file
require_once 'raws_json/json_client.php';
require_once 'raws_json/rats_service.php';
try {
    $rats = new RatsService(USER, PWD);
    $transc_filename = null;
    echo "\nGetting transc list:";
    $transc_list = $rats->getTranscList();
    foreach ($transc_list->feed->entry as $o) {
        echo "\n Transc has filename = " . $o->content->params->filename;
        $transc_filename = $o->content->params->filename;
    }
    # retrieve a single transc instance based on the filename
    $transc = $rats->getTranscInstance($transc_filename);
    echo "\nRetrieved transc with filename = " . $transc->entry->content->params->filename;
    # retrieve a single transc instance based on the filename
    $downloaded_filepath = $rats->getTranscFile($transc_filename, DOWNLOAD_PATH);
    echo "\nDownloaded transc to location = " . $downloaded_filepath;
    # delete transc
    $rats->deleteTransc($transc_filename);
    echo "\nDeleted transc with filename = " . $transc->entry->content->params->filename;
} catch (Exception $e) {
    echo "\nAn exception occurred with code = " . $e->getCode();