Use a js).wav File
Copy codeThe Code is as follows:
<Html>
<Head>
<Script language = "javascript">
Function playSound (id)
{
Var node = document. getElementById (id );
If (node! = Null)
{
Node. Play ();
}
}
</Script>
</Head>
<Body>
<Embed name = "3_devUnknown" id = "3_devUnknown" src = "music.wav" type = "audio/x-wav" hidden = "true" autostart = "false" loop = "false "/> <a onclick =" javascript: playSound ('3 _ devUnknown ') "href =" # "> music.wav </embed/>
</Body>
</Hmtl>
Var recordhisStore = new Ext. data. JsonStore ({
Root: 'datarot ',
TotalProperty: 'totalcount ',
IdProperty: 'threadid ',
RemoteSort: true,
Fields :[
{Name: 'id', type: 'string '},
{Name: 'src', type: 'string '},
{Name: 'dst ', type: 'string '},
{Name: 'srcip ', type: 'string '},
{Name: 'dstamp', type: 'string '},
{Name: 'In in _ date', type: 'date', dateFormat: 'Y-m-d H: I: s'}, // onclick = 'javascript: startwav (\ "" + value + "\")'
{Name: 'End _ date', type: 'date', dateFormat: 'Y-m-d H: I: s '},
{Name: 'content', type: 'string', convert: function (value, rec ){
Return "<embed id = '" + rec. id + "_ devUnknown 'name = '" + rec. id + "_ devUnknown 'src}'music.wav 'loop = false autostart = false hidden = true> <a href =' # 'onclick = \" javascript: playSound ('"+ rec. id + "_ devUnknown ') \"> "+ value +" </a> </embed> ";
}}
],
Proxy: new Ext. data. HttpProxy ({
Url: 'ctl. php? C = HisRecordQueryController & a = query'
}),
SortInfo: {field: 'In in _ date', ction: 'asc '},
Listeners :{
Beforeload: function (obj, params ){
Var begin_date = document. getElementById ("his_startdt"). value;
Var end_date = document. getElementById ("his_enddt"). value;
Var src = document. getElementById ("his_src"). value;
Var dst = document. getElementById ("his_dst"). value;
RecordhisStore. baseParams = {limit: params. params. limit, start: params. params. start, begindate: begin_date, enddate: end_date, src: src, dst: dst };
}
}
});
Js player wav Files
Copy codeThe Code is as follows:
Use js to play the corresponding wav file every 1 s
<Script language = "javascript">
Var arr = new Array ();
Var c = 0;
Window. onload = function (){
Var value1 = '<% = tel_2 %> ';
Var value2 = '<% = je %>'
StrToArray (value1 );
StrToArray (value2 );
}
Var StrToArray = function (str ){
For (var I = 0; I <str. length; I ++ ){
Arr [arr. length] = str. charAt (I );
}
}
Var id = window. setInterval (function (){
If (c> arr. length ){
Window. clearInterval (id); // clear
Return;
}
Embed (arr [c ++]);
},1000 );
Var embed = function (num ){
If (num = "" | typeof num = "undefined") return;
Document. getElementById ("embed "). innerHTML = "<embed name = \" player \ "TYPE = \" application/x-mplayer2 \ "src = \".. /wav/"+ num + ". wav \ "loop = \" false \ "autostart = \" true \ "hidden = \" true \ "> </embed> ";
}
</Script>