var ApiUrl = {
/**
* 视频url
* @type
*/
video:{
/**
* @name 查询整合的视频
* @param
* query:查询值,
* num:返回最大的结果集
* @type String
* @ApiReturn
* head:查询参数
* item:结果集{clss:类型名,
* ex:{typeid:类型id,title:连续剧状态描述(例如:全38集,更新至)}
* ,id:cid或者是vid,
* title:主题,url:地址}
*/
searchList:"http://ncgi.video.qq.com/tvideo/fcgi-bin/smartbox?plat=2&otype=json",
/**
* @param cid:视频coverid
* @ApiReturn
* actor:演员
* area:地区
* director:导演
* brief:简要
* edition:版
* lang:语言
* pic1:图片1
* pic2:图片2
* sectitle:小标题
* title:标题
* typeid:类型
* varietytitle:品种标题
* videos:视频集 {vid:播放id,tt:标题,pic:图片}
* @type String
*/
searchInfo:"http://mobile.video.qq.com/fcgi-bin/dout_pc?otype=json&auto_id=137",
/**
* 参数
* comment: 0,
* stype: 0,
* plat: 2,
* otype: 'json', 返回类型设置为json
* query: 搜索值,
* pver: 0,
* tabid: 视频类型参考Constant.TabidType,
* sort: 大类型,参考Constant.SortMap,
* cur: 当前页码,
* num: 页面数据量,
* start: 0,
* end: 0,
* stag: '',
* preqid: '',
* rsrc: 0
* @type String 有注释的可以填写,其他默认
* @ApiReturn AC:地区, AF:no, AG:语言, AI:no, AM:no, AN:子视频集数, AP:, AQ:视频质量, AR:no, AT:no, AU:图片, AW:播放地址, AY:年份,
* BB:no, BC:类型名称, BD:导演, BE:小标题, BG:no, BM:成员,演员, BN:no, BS:no, BT:no, CR:no, ID:播放id,分cid,vid, SY:no,
* TE:no, TF:视频简要内容, TI:标题+关键字, TK:简介整个内容, TO:no, TX:no, VA:no, VC:no, VD:no, Z1:扩展, title:标题
*/
searchAdvance:"http://ncgi.video.qq.com/tvideo/fcgi-bin/search",
/**
* 百度视频api
* @param word
* @type String
*/
baiduVideo:'http://v.baidu.com/v?rn=60&ct=905969664&fid=&db=0&s=0&fr=videoMultiNeed_22_43_22_22_21&pn=0&1376572823685',
/**
* 百度自动补全
* @param wd:值,prod:产品类型,如video,image
* @return {}
* @returns {s:[结果字符数组]}
*/
baiduAuto:function(){
return 'http://nssug.baidu.com/su?ie=utf-8&t='+Math.random();
},
history:'/share/option.file?method=historyVideo',
store:'/share/option.file?method=storeVideo',
remove:'/share/option.file?method=removeVideo'
},
music:{
/**
* @param key 查询关键字
* 查询自动补全
* 返回 调用MusicJsonCallback方法 传递音乐对象
* song 音乐集合 id:,mid:,name,singer_name
* mv mv集合 id,mid,name,singer_name,vid播放视频的id
* @type String
*/
autoComplete:'http://s.plcloud.music.qq.com/fcgi-bin/smartbox.fcg?o_utf8=1&utf8=1&g_tk=5381&loginUin=0&hostUin=0&format=jsonp&inCharset=GB2312&outCharset=utf-8¬ice=0&platform=yqq&jsonpCallback=MusicJsonCallback&needNewCode=0',
/**
* 得到某qq号的歌曲清单
* @type String
*/
userMusicList:'http://qzone-music.qq.com/fcg-bin/fcg_music_fav_getinfo.fcg?dirinfo=1&dirid=200',
/**
* 方法, 随机分类音乐
* @param 传递音乐类型 参考 Constant.RandomType
*
*/
randomTypeMusic:function(num){
var num1 = Math.floor(Math.random() * 150);
return "http://music.qq.com/musicbox/shop/v3/data/random/" + num + "/random" + num1 + ".js?p=" + Math.random();
},
rankTypeMusic:function(link){
return 'http://music.qq.com/musicbox/shop/v3/data/hit/hit_' + link + '.js?p=' + Math.random();
},
/**
* 搜索音乐
* value:查询值 encodeURI
* page_no 当前页
* page_record_num 页面大小
*/
searchMusic:'/share/option.file?method=searchMusic',
searchMusic1:'http://shopcgi.qqmusic.qq.com/fcgi-bin/shopsearch.fcg?type=qry_song&page_no=1&page_record_num=150',
/**
* 加载歌词
* url:歌词url
* 返回:lrcCallBack([{content:内容,ms:毫秒}])
*/
searchMusicLry:'/share/option.file?method=searchLrc',
his:"/share/option.file?method=history",
storeMusic:"/share/option.file?method=add",
remove:"/share/option.file?method=remove"
},
weather:{
city:"/share/option.file?method=cityList",
getCity:"/share/option.file?method=getCity",
/**
* 天气 参数:city名称
*/
weatherQQ:"/share/option.file?method=qqWeather",
/**
* 天气 参数:city id
*/
myWeather:"/share/option.file?method=getWeather",
his:"/share/option.file?method=getQueryHis&type=weather"
},
queryInput:"/share/option.file?method=getQueryHis",
modifyInput:"/share/option.file?method=modifyInputHis"
};
var ApiImpl={
_videoReq:false,
_musicReq:false,
_mvReq:false,
/**
* mv音乐回调函数
* @type Boolean
*/
MVJsonCallBack:false,
/**
* 用户音乐回调函数
* @type Boolean
*/
userListCallback:false,
/**
* 随机和排行榜音乐回调函数
* @type Boolean
*/
randTypeCallback:false,
/**
* 查询音乐回调函数
* @type Boolean
*/
searchMusicCallBack:false,
baiduVideoCallBack:false,
/**
* 查询整合的视频
* @param {} v 值
* @param {} suc
*/
searchVideo:function(v,suc,async){
this._videoReq && this._videoReq.abort();
if (async)
this._videoReq = Request.jsonp(ApiUrl.video.searchList,{query:v,num:100},suc);
else
this._videoReq = Request.syncJsonp(ApiUrl.video.searchList,{query:v,num:100},suc);
},
/**
* 模糊查询
* @param {}参数对象 , suc:回调函数
*/
advanceParams:new VideoParam(),
advanceParams1:new VideoParam(),
searchVideoZheng:function(data,suc){
var param = new VideoParam();
$.extend(param,data);
this._videoReq && this._videoReq.abort();
this._videoReq = Request.jsonp(ApiUrl.video.searchAdvance,param,suc);
},
searchVideoAdvance:function(data,suc){
var param = this.advanceParams;
$.extend(param,data);
this._videoReq && this._videoReq.abort();
this._videoReq = Request.jsonp(ApiUrl.video.searchAdvance,param,suc);
},
/**
* 模糊查询1
* @param v:查询值,page:页,type:类型,sort:排序类型, suc:回调函数
*/
searchVideoAdvance1:function(v,page,type,sort,suc){
this.searchVideoAdvance({query:v,cur:page,tabid:type,sort:sort},suc);
},
/**
* 首次模糊查询
* @param 查询值 , suc:回调函数
*/
searchVideoAdvance2:function(v,suc){
this.searchVideoAdvance1(v,0,Constants.TabidType.All,Constants.SortMap.RELE,suc);
},
/**
* 根据Sort查询
* @param sort:排序类型, suc:回调函数
*/
searchVideoAdvanceSort:function(sort,suc){
this.searchVideoAdvance({sort:sort},suc);
},
/**
* 根据类型查询
* @param sort:排序类型, suc:回调函数
*/
searchVideoAdvanceType:function(type,suc){
this.searchVideoAdvance({tabid:type},suc);
},
/**
* 分页查询
* @param page:页码, suc:回调函数
*/
searchVideoAdvancePage:function(page,suc){
this.searchVideoAdvance({cur:page},suc);
},
/**
* 得到视频信息
* @param {} cid
* @param {} suc
*/
getVide
没有合适的资源?快使用搜索试试~ 我知道了~
包含多个http方式调用,返回json数据的接口。 可以搜索歌曲,模糊搜索,搜索歌词。 更有mv等相关搜索。 20140530 测试接口均可以使用。
资源推荐
资源详情
资源评论
收起资源包目录
api.zip (1个子文件)
api.js 28KB
共 1 条
- 1
资源评论
icewst
- 粉丝: 39
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功