|
尝试了 也是本地可以 编译后不行
- // ···································
- $api.attr($api.dom('#dow'),'src','../images/spxz_b.gif')
- var videoname = Math.random().toString(36).slice(-9);
- videoname = "fs://"+videoname+".mp4"
- console.log(videoname)
- api.download({
- url: api.pageParam.httpUrl,
- savePath: videoname,
- report: true,
- cache: true,
- allowResume: true
- }, function(ret, err) {
- if (ret.state == 1) {
- api.saveMediaToAlbum({
- path: videoname,
- groupName:'HuaChat'
- }, function(ret, err) {
- $api.attr($api.dom('#dow'),'src','../images/spxz1.png')
- if (ret && ret.status) {
- api.toast({
- msg: '下载成功,视频已保存到相册!',
- duration: 2000,
- location: 'middle'
- });
- } else {
- api.toast({
- msg: '下载失败,请稍后重试...',
- duration: 2000,
- location: 'middle'
- });
- }
- });
- } else {
- // api.toast({
- // msg: '下载失败,请稍后重试...',
- // duration: 2000,
- // location: 'middle'
- // });
- }
- });
- // ···································
复制代码 |
|