Today with FlowPlayer pull the flow encountered a more wonderful problem, the general idea is JS based on the name of the page using AJAX to get the number from the background, and then use the number to create a task output rtmp stream, FlowPlayer to play, But FlowPlayer initialization of the time reported a p.replace is not a function error, roughly speaking FlowPlayer library of some functions do not define it, has been thought to be a library reference problem, for a half-day has not been resolved, the last layer of tracking, Found directly with the name of the creation of the task is normal, according to the number is not normal, all the problems are definitely in the Ajax get number This step, the beginning of writing is to return a String, instead of returning list<string>, this problem is very covert, Because the tracking code when the string is returned, the returned value is normal, the estimated format is not correct, resulting in a subsequent error, the errors are in the reference Library JS code. The following code is attached.
Java code:
@RequestMapping (value = "Getterminalnumber")
@ResponseBody public
list<string> Getterminalnumber (@ Requestparam String name) {//note, returns the List type
list<string> checkret = new arraylist<string> ();
String number = "";
list<terminalconfigpo> Terminalconfigpos = Terminalconfigdao.findbyfield ("TerminalName", name);
if (Terminalconfigpos.size () >0) {Number
= Terminalconfigpos.get (0). Gete164number ();
Checkret.add (number);
return checkret;
}
JS Code:
var Telnumber;
$.ajax ({
type: "POST",
URL: path+ '/ajax/getterminalnumber ',
cache:false,
async:false, / /sync
data:{"name": name},
DataType: "JSON",
success:function (ret) {
if (ret.length>0) {
Telnumber = ret[0];
}
,
error:function (ret) {
return;}
});