Hi,
I am working on video mixing with rtmp video streaming. in which i want a video duration which is send by client side script to the wowza streaming server.
after getting the time duration of movie i shall make a break point in which we have to add ads in each interval(means breakpoint).
My Code is:
public void play(IClient client, RequestFunction function,
AMFDataList params){
File folder = new File("C:/Program Files/Wowza Media Systems/Wowza Media Server Pro 1.7.2/content/ads");
File[] listOfFiles = folder.listFiles();
int cont = listOfFiles.length;
Random r = new Random();
int randint = r.nextInt(cont);
String adname = listOfFiles[randint].getName();
String adsurl = "ads/"+adname;
String videoname1 = getParamString(params, PARAM1);
String start1 = getParamString(params, PARAM2);
String length1 = getParamString(params, PARAM3);
[B]System.out.println("Movie length: "+length1);[/B] // is not working
/*DateFormat dateFormat = new SimpleDateFormat("mm:ss");
Date date = new Date();
String t = dateFormat.format(date);*/
AMFDataList customDataList = new AMFDataList();
customDataList.add("play");
customDataList.add(0.0);
customDataList.add("null");
customDataList.add(adsurl);
/* customDataList.add("Extremists.flv"); */
customDataList.add(new AMFDataItem(0));
customDataList.add(new AMFDataItem(-1)); // 10,000 milliseconds (10 seconds)
customDataList.add(new AMFDataItem(true));
ModuleCore.play(client, function, customDataList);
customDataList.set(PARAM1, new AMFDataItem(videoname1));
customDataList.set(PARAM2, new AMFDataItem(0));
customDataList.set(PARAM3, new AMFDataItem(-1));
customDataList.set(PARAM4, new AMFDataItem(false));
this.invokePrevious(client, function, customDataList);
ModuleCore.play(client, function, customDataList);
}
The value of length1 is comming “null” on console.
if i print the value of videoname1, the it prints.
please suggest me a right way to do that.
thanks