How to Stream RTMP in PopUP InfoWindow

3004
1
12-13-2015 06:31 AM
CharlesGant
New Contributor III

Hello all,

I'm trying to play RTMP video using FlowPLayer in a popup info window.  When I execute the code below I get No errors, however the infowindow is blank.  I couldn't find examples of how to embed the player directly, thus I tried to use a method I found of embedded html into the infowindow.  Thus I tried creating the div needed within the infowindow, but no luck.  Bare player code works great in test HTML.  Has anyone accomplished this?

Thanks,

Charles.

//Add WebCams CSV Layers
var WebCamsCSVtemplate = new InfoTemplate();
WebCamsCSVtemplate.setTitle("<b>${Location}</b>");
WebCamsCSVtemplate.setContent(getWebCamsCSVTextContent);
var WebCams = new CSVLayer("./webcams.csv",{id:"WebCams",refreshInterval: 1.0,mode: FeatureLayer.MODE_SELECTION,outFields: ["*"],infoTemplate: WebCamsCSVtemplate});
var symbol =  new PictureMarkerSymbol({"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"http://static.arcgis.com/images/Symbols/PeoplePlaces/Camera.png","contentType":"image/png","width":20,"height":20});
var renderer = new SimpleRenderer(symbol);
WebCams.setRenderer(renderer);
map.addLayer(WebCams);
WebCams.hide();
function getWebCamsCSVTextContent (graphic) {
map.infoWindow.resize(500,480);
var URL = '10004'
var netConnectionURL = 'Some RTMP Server'
playerhtml = '<div id="playerdiv" style="width:500px;height:480px;margin:0 auto;text-align:center"></div>';
map.infoWindow.setContent(playerhtml);
$f("playerdiv", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
clip: {url: URL,scaling: 'fit',provider: 'hddn'},
plugins: {hddn: {url: "flowplayer.rtmp-3.2.13.swf",netConnectionUrl: netConnectionURL}},
canvas: {backgroundGradient: 'none'}
});
};
0 Kudos
1 Reply
thejuskambi
Occasional Contributor III

Hello Charles,

I am not sure using, setContent which takes html string, will immediately allow you to access the it as dom object. i.e. $f("playerdiv") might not return an object. Please check if it not null. Also, should it be "$" or "$f". Consdering, it works, the getWebCamsCSVTextContent function is supposed to return a string or deferred object which will be displayed in the info window. since you are not returning anything, may be it is clearing the content that you have update.

Is it possible to setup a jsbin to take a look at it.

Thejus