小程序体验

下载源码:源码下载

js

var services = require('../../lib/service')var ReceiverOptions = null;
Page({data: {loading: false,videoInfo: {}, //{videoId:0,videourl:'',title:''}//0:加载完成(还有数据)  1:加载中  2:加载完成(没有更多数据了)searchLoadingStatus: 2,//1:已授权  0:未授权typeCode: 0,//搜索位置名称searchKeyWord: '',systemInfo: {},//视频下载状态 0:未下载  1:正在下载videoDownLoadStatus: 0,videoDownProgress: 0,videoPlayCoverList: [],//是否显示下载视频按钮showDownLoadBtn: false,//显示分享按钮showShareVideoBtn: false,//是否显示在线客服showOnlineKf: false,//积分总数creditsAmountSum: 0,//视频下载UrldownLoadVideoUrl: '',//视频下载提示语downloadVideoWaitRemindText: '正在生成视频地址,请稍后...'},onLoad(options) {var that = this;wx.getSystemInfo({success: function(res) {that.setData({systemInfo: res //windowWidth,windowHeight});console.log(res);}});getApp().getWxLoginInfo(function() {that.loadSupportPlat(true);that.videoSystemSetting();});},onShow() {var that = this;var userLoginStatus = getApp().globalData.UserInfo.UserLoginStatus;if (userLoginStatus) {that.loadSupportPlat(false);}wx.getClipboardData({success(res) {console.log(res.data);var linkStr = res.data;if (linkStr.indexOf('http:') >= 0 || linkStr.indexOf('https:') >= 0) {//清空剪切板内容wx.setClipboardData({data: ' ',success(clearRes) {wx.hideToast();}})wx.showModal({title: '是否粘贴剪切板中的链接地址',content: linkStr,success(res) {if (res.confirm) {that.setData({searchKeyWord: linkStr});}}})}}})that.setData({searchLoadingStatus: 2});},loadSupportPlat: function(loading) {var that = this;services.service('minivideo/getplatlist', {"WxUserId": 0},function(res) {console.log(res);that.setData({videoPlayCoverList: res.data.Data});}, null, null, loading);},loadShareVideo: function() {let that = this;var videoId = that.data.videoInfo.videoId;//videoId = 10004;if (videoId > 0) {services.service('minivideo/getvideoinfo', {"WxUserId": 0,"VideoId": videoId},function(res) {console.log(res);if (res.data.Status) {var analysisStatus = res.data.Data.AnalysisStatus;var showDownLoadBtn = false;//下载成功,显示下载,分享按钮if (analysisStatus == 3) {showDownLoadBtn = true;}that.setData({downloadVideoWaitRemindText: '',showDownLoadBtn: showDownLoadBtn,showShareVideoBtn: true,videoInfo: {videoId: videoId,videourl: res.data.Data.VideoUrl},downLoadVideoUrl: res.data.Data.VideoUrl});}}, null, null, true);} else {}},//系统设置videoSystemSetting: function() {let that = this;services.service('minivideo/getconfig', {},function(res) {console.log(res);if (res.data.Status) {that.setData({showShareVideoBtn: res.data.Data.ShowShareVideo,showOnlineKf: res.data.Data.ShowOnlineKf});}}, null, null, false);},//保存视频到相册btnSaveVideo: function() {var that = this;wx.authorize({scope: "scope.writePhotosAlbum",success: function() {var downLoadStatus = that.data.videoDownLoadStatus;if (downLoadStatus == 0) {var videourl = that.data.downLoadVideoUrl;if (videourl == null || videourl == '') {that.showToast('请先提取视频');return;}that.setData({videoDownLoadStatus: 1,videoDownProgress: 0})const downloadTask = wx.downloadFile({url: videourl,success(res) {if (res.statusCode === 200) {wx.saveVideoToPhotosAlbum({filePath: res.tempFilePath,success(res) {//保存成功that.showSuccessToast('已保存到相册');},fail(res) {console.log(res);that.showToast('保存失败');}})}},fail(res) {that.showToast('下载视频失败');},complete(res) {that.setData({videoDownLoadStatus: 0})}})//监听下载进度downloadTask.onProgressUpdate(function(res) {that.setData({videoDownProgress: res.progress})})}},fail: function() {that.showToast('授权保存视频到相册失败,请删除该小程序重新授权');}});},//复制链接copyVideoLink: function() {var that = this;var videoUrl = that.data.videoInfo.videourl;wx.setClipboardData({data: videoUrl,success(res) {that.showToast('复制成功')}});},//搜索bindSearchTap: function(e) {console.log('开始提取视频')console.log(e);var that = this;var searchLoadingStatus = that.data.searchLoadingStatus;if (searchLoadingStatus != 1) {that.setData({//加载中searchLoadingStatus: 1});var _userInfo = e.detail.userInfo;if (_userInfo != null && _userInfo != undefined) {//先授权getApp().authorUserInfo(_userInfo, function(data) {that.getVideoPlayUrl();}, false);} else {that.showToast("请先允许微信授权");that.setData({//加载中searchLoadingStatus: 2});}}},//使用教程bindUseCourse: function(e) {wx.navigateTo({url: '../useCourse/useCourse'});},//跳转到位置收藏大师navigateToLocationMiniProgram: function(e) {var wxUserId = getApp().globalData.UserInfo.WxUserId;wx.navigateToMiniProgram({appId: 'wxb91f7b85c23f0624',path: 'pages/home/home?skip=' + wxUserId,//extraData: {//  flag: 'Skip_1'//},envVersion: 'release',success(res) {// 打开成功},fail(res) {that.showToast('调起小程序失败,请稍后重试');}})},//清空输入框clearInput: function() {var that = this;that.setData({searchKeyWord: ''});},//输入框输入监听searchInputMonitor: function(e) {var that = this;that.setData({searchKeyWord: e.detail.value});},//提取视频getVideoPlayUrl: function() {var that = this;that.startGetVideoPlayUrl();},startGetVideoPlayUrl: function() {var that = this;var wxUserId = getApp().globalData.UserInfo.WxUserId;var keyword = that.data.searchKeyWord;services.service('minivideo/addvideourl', {WxUserId: wxUserId,OriginalUrl: keyword,XcxTypeCode: 1},function(res) {if (res.data.Status) {var videoUrl = res.data.Data.VideoUrl;var videoRecordId = res.data.Data.VideoRecordId;var videoImgs = res.data.Data.Imgs;that.setData({videoInfo: {videoId: videoRecordId,videourl: videoUrl,title: '',imgs: videoImgs}});var needDownLoadToServer = res.data.Data.NeedDownLoadToServer;if (needDownLoadToServer) {if (videoUrl != null && videoUrl != '') {that.downLoadVideoToServer(wxUserId, videoUrl, videoRecordId);}} else {that.setData({downLoadVideoUrl: videoUrl,showDownLoadBtn: true});}} else {wx.showModal({content: res.data.Msg,showCancel: false})}}, null,function() {that.setData({//加载完成searchLoadingStatus: 2});})},//下载视频到服务器downLoadVideoToServer: function(wxUserId, videoUrl, videoRecordId) {var that = this;that.setData({showDownLoadBtn: false,downloadVideoWaitRemindText: '正在生成视频地址,请稍后...'});services.service('minivideo/downloadvideo', {"WxUserId": wxUserId,"VideoUrl": videoUrl,"VideoRecordId": videoRecordId},function(res) {if (res.data.Status) {var url = res.data.Data.Url;that.setData({downLoadVideoUrl: url,showDownLoadBtn: true});} else {that.showToast(res.data.Msg);that.setData({showDownLoadBtn: false,downloadVideoWaitRemindText: res.data.Msg});}}, null, null, false);},//如何获取更多次数getTimesMore: function() {wx.navigateTo({url: '../getTimesMore/getTimesMore'});},showToast(title) {wx.showToast({title: title,icon: 'none',duration: 2000})},onShareAppMessage: function(res) {let that = this;return {path: '/pages/home/home'}}
});

wxml


<view class="search" bindtap="suo"><!--<icon class="search-img" type="search" size="13" />--><input class="search-ipt" value='{{searchKeyWord}}' type="text" bindinput="searchInputMonitor" placeholder="链接地址" placeholder-class="placeholder-color" /><view class="weui-icon-clear" bindtap="clearInput"><icon type="clear" size="23"></icon></view><!-- <text class="search-btn" bindtap="bindSearchTap">提取</text>--><form bindsubmit="getFormId" report-submit="true"><button type="primary" class='search-analysis' bindgetuserinfo='bindSearchTap' open-type="getUserInfo">解析</button></form>
</view>
<view class='support-remind'><view class="clearfix"></view><view class="content-attr clearfix"></view><view class="flex-wrp"><block wx:for="{{videoPlayCoverList}}"><view style='width:48px;float:left;margin-left:20px'><view style='text-align:center'><image mode='aspectFit' style='width:35px;height:35px;' src='{{item.Icon}}'></image></view><view class='support-text-app'><text>{{item.Name}}</text></view></view></block></view><view class="content-attr clearfix"></view>
</view>
<view class="clearfix"></view>
<!--视频区域-->
<block wx:if='{{videoInfo.videourl!=null && videoInfo.videourl!=""}}'><view class="order-cell"><!--cell-status clearfix--><view class=""><text>{{videoInfo.title}}</text></view><video id="myVideo" autoplay="true" style='width:{{systemInfo.windowWidth-20}}px;height:{{VideoHeight}}px;margin-left:10px;margin-right:10px;' src="{{videoInfo.videourl}}"></video><view class="clearfix"></view><view wx:if="{{!showDownLoadBtn}}" class='videoUrlWaitRemind'>{{downloadVideoWaitRemindText}}</view><button type="primary" bindtap="btnSaveVideo" class='videoDownShareLeft' wx:if="{{showDownLoadBtn}}"><block wx:if="{{videoDownLoadStatus==0}}"><text>下载视频</text></block><block wx:else><text>正在下载({{videoDownProgress}}%)</text></block></button><button type="warn" bindtap="copyVideoLink" class='videoDownShareRight'><block><text>复制链接</text></block></button></view>
</block><view style='margin-top:20px;'><view class='useCourse' bindtap="bindUseCourse">教程</view><button class='contactService' open-type="contact" wx:if="{{showOnlineKf}}"><view>客服</view></button><button class='shareXcx' open-type="share" wx:if="{{showShareVideoBtn}}"><view>分享</view></button>
</view>
<view class="clearfix"></view>
<view class='clsGetTimesWay' bindtap="getTimesMore" style='width:{{systemInfo.windowWidth-20}}px;height:200rpx;margin-left:10px;margin-right:10px;'><view style='float:left;width:{{systemInfo.windowWidth-20-70}}px;'><view class='clsGetTimesWayText'>如何获取更多次数?</view><view class='clsGetTimesWayRemind'>转发邀请好友</view><view class='clsGetTimesWaySee'>查看>></view></view><view style='float:left'><image style='width:64px;height:64px;margin-top:10px;' src='/images/times2.png'></image></view>
</view>
<view class="clearfix"></view>

微信小程序短视频去水印解析相关推荐

  1. 微信小程序短视频去水印,王者查战力,手持弹幕,获取头像壁纸,工具箱源码

    短视频在线去水印,无任何广告 王者荣耀查荣耀战力已更新 新增加查看历史上的今天 新增手持弹幕,修复剪辑视频不能保存问题. 新增壁纸,头像,网址转二维码. [微信小程序]:好野工具 [小程序版本]:5. ...

  2. 微信小程序短视频去水印工具源码

    介绍: 看到咸鱼上还有人卖这套源码,所以我就把这套源码分享出来,开源产品,未加密未授权,可调用别人的接口和自己的接口. 网盘下载地址: https://zijiewangpan.com/nemDsyf ...

  3. 微信小程序短视频qu水印源码

    介绍: 看到咸鱼上还有人卖这套源码,所以我就把这套源码分享出来,开源产品,未加密未授权,可调用别人的接口和自己的接口. 网盘下载地址: https://zijiewangpan.com/3j3WhC4 ...

  4. 微信程序短视频去水印源码 开源产品未加密未授权相关文章

    微信程序短视频去水印源码 开源产品未加密未授权相关文章 看到咸鱼上还有人卖这套源码,所以就把这套源码 免费分享出来 开源产品,未加密未授权,可调用别人的接口和自己的接口. PS:源码仅供技术学习参考, ...

  5. 微信小程序 RTMP 音视频 通话 ffmpeg_WebRTC与微信小程序音视频互通方案设计与实现...

    背景 在之前的WebRTC实时音视频通话之语音通话设计与实践中介绍了58 TEG部门基于 WebRTC 的实时音视频通话解决方案. 考虑到腾讯微信的小程序平台提供了音视频通话与直播的支持,如果能打通基 ...

  6. Android微信小程序原理,微信小程序事件流原理解析

    这篇文章主要介绍了微信小程序事件流原理解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 一.什么是事件? 事件是视图层到逻辑层的通讯方式: 事件可 ...

  7. 微信小程序下载视频到相册(带进度条)

    微信小程序下载视频到相册,并带进度条 <button class="desc-note my-button u-font-32" @click="toUpload( ...

  8. 腾讯技术分享:微信小程序音视频与WebRTC互通的技术思路和实践

    概述 本文来自腾讯视频云终端技术总监rexchang(常青)技术分享,内容分别介绍了微信小程序视音视频和WebRTC的技术特征.差异等,并针对两者的技术差异分享和总结了微信小程序视音视频和WebRTC ...

  9. 腾讯技术分享:微信小程序音视频技术背后的故事

    1.引言 微信小程序自2017年1月9日正式对外公布以来,越来越受到关注和重视,小程序上的各种技术体验也越来越丰富.而音视频作为高速移动网络时代下增长最快的应用形式之一,在微信小程序中也当然不能错过. ...

  10. 微信小程序--获取视频链接(Videourl)方法~~~

    微信小程序–获取视频连接(videourl)方法~~~ 如何获取音乐MV的URL地址 虾米音乐 试了很多音乐网站发现"虾米音乐"的MV的URL地址是可以获取的,并且在微信小程序播放 ...

最新文章

  1. 4 种数据库缓存最终一致性的优缺点对比?最终选择方案四!
  2. ubuntu下打开matlab_ubuntu终端命令启动matlab方法
  3. 轻量级大规模机器学习算法库Fregata开源:快速,无需调参
  4. jdk7启动时报“java.lang.VerifyError:Expecting a stackmap frame at branch target”
  5. ajax存储单个数据_科学家现在可以使用单个原子存储数据
  6. 新手必读:PhoneGap入门六大问题
  7. 国内8大知名工程项目管理软件推荐
  8. linux 编译 pascal,免费开源的Pascal编译器 GNU Pascal
  9. Chromium OS Autotest 客户端测试
  10. VOC数据集介绍及构建自己的VOC格式目标检测数据集
  11. 10^5以下素数筛法——素数表法
  12. 使用setkey手工配置IPSec
  13. SpeedPan百度云不限速下载
  14. 直播服务器不能正常运行,解决人人商城互动直播通信服务无法通信问题
  15. 网络爬虫playwright实现网站自动登录并签到
  16. BZOJ 2565 最长双回文串
  17. Haskell语言学习笔记(73)Existentials
  18. 毁灭一切还是重塑世界?AI已成为人类故事中心
  19. 数学分析(5): 导数
  20. Beginning WF4读书笔计 - 第一章 03设计示图及xaml代码

热门文章

  1. Java:HttpClient篇,HttpClient4.2在Java中的几则应用:Get、Post参数、Session(会话)保持、Proxy(代理服务器)设置,多线程设置......
  2. js 单精度浮点数转10进制_js浮点数精度问题的前世今生?
  3. 大数据Hadoop学习文章汇总
  4. 2016版excel_【重磅分享】最完整EXCEL教程,视频+PPT下载
  5. 非参数统计的Python实现—— Fisher 精确性检验
  6. VC++实现快速截屏
  7. 计算机二级c语言选择题pdf,计算机二级c语言选择题库(带答案)[汇编].pdf
  8. eclipse安装SVN插件(2020最新,亲测可用)
  9. Java 并发编程的艺术
  10. HTML5 - WebSQL