Question

I am trying to make a call so that when a title of a video is clicked on in my playlist, it will call back a particular videos url to be shown in the metadata field box that I have created.

So far I am getting results but the function below that I am using is giving me rmtp url's like this:

(rtmp://brightcove.fcod.llnwd.net/a500/d16/&mp4:media/1978114949001/1978114949001_2073371902001_How-to-Fish-the-Ice-Worm.mp4&1358870400000&7b1c5b2e65a7c051419c7f50bd712b1b )

Brightcove has said to use (FLVURL&media_delivery=http).

I have tried every way I know of to put a media delivery in my function but always come up with nothing but the rmtp or a blank.

Can you please help with the small amount of code I have shown. If I need to show more that is not a problem. Thanks

function showMetaData(idx) {
    $("tr.select").removeClass("select");
    $("#tbData>tr:eq("+idx+")").addClass("select");

    var v = oCurrentVideoList[idx];

    //URL Metadata
    document.getElementById('divMeta.FLVURL').innerHTML = v.FLVURL;

Here is my Population call for my list.

//For PlayList by ID

function buildMAinVideoList() {

//Wipe out the old results
$("#tbData").empty();

console.log(oCurrentMainVideoList);
oCurrentVideoList = oCurrentMainVideoList;
// Display video count
document.getElementById('divVideoCount').innerHTML = oCurrentMainVideoList.length + " videos";
document.getElementById('nameCol').innerHTML = "Video Name";
//document.getElementById('headTitle').innerHTML = title;
document.getElementById('search').value = "Search Videos";
document.getElementById('tdMeta').style.display  = "block";
document.getElementById('searchDiv').style.display  = "inline";
document.getElementById('checkToggle').style.display  = "inline";
$("span[name=buttonRow]").show();
$(":button[name=delFromPlstButton]").hide();


//For each retrieved video, add a row to the table
var modDate = new Date();
$.each(oCurrentMainVideoList, function(i,n){
    modDate.setTime(n.lastModifiedDate);
    $("#tbData").append(
        "<tr style=\"cursor:pointer;\" id=\""+(i)+"\"> \
        <td>\
            <input type=\"checkbox\" value=\""+(i)+"\" id=\""+(i)+"\" onclick=\"checkCheck()\">\
        </td><td>"
            +n.name +
        "</td><td>"
            +(modDate.getMonth()+1)+"/"+modDate.getDate()+"/"+modDate.getFullYear()+"\
        </td><td>"
            +n.id+
        "</td><td>"
            +((n.referenceId)?n.referenceId:'')+
        "</td></tr>"
    ).children("tr").bind('click', function(){
        showMetaData(this.id);
    })
});

//Zebra stripe the table
$("#tbData>tr:even").addClass("oddLine");

//And add a hover effect
$("#tbData>tr").hover(function(){
    $(this).addClass("hover");
}, function(){
    $(this).removeClass("hover");
});

//if there are videos, show the metadata window, else hide it
if(oCurrentMainVideoList.length > 1){showMetaData(0);}
else{closeBox("tdMeta");}
}
Was it helpful?

Solution

If looking for HTTP paths, when the API call to Brightcove is correct you won't see the rtmp:// urls.

Since you're getting the rtmp URLs, this verifies you're using an API token with URL access, which is good. A request like this should return the playlist and the http URLs (insert your token and playlist ID).

http://api.brightcove.com/services/library?command=find_playlist_by_id&token={yourToken}&playlist_id={yourPlaylist}&video_fields=FLVURL&media_delivery=http

This API test tool can help build the queries for you, and show the expected results: http://opensource.brightcove.com/tool/api-test-tool

I'm not seeing what would be wrong in your code, but in case you haven't tried this already, debugging in the browser can help you confirm the API results being returned, without having to access it via code. This help you root out any issues with the code you're using to access the values, vs problems with the values themselves. This is an overview on step-debugging in Chrome if you haven't used this before: https://developers.google.com/chrome-developer-tools/docs/scripts-breakpoints

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top