微信小程序基于ColorUI構建皮皮蝦短視頻去水印組件
沒錯,我是皮友,我想學習舞蹈(/doge)和瑜伽 ,要無水印的那種有助于我加深學習。
1.組件效果展示
2.組件引入準備
https://spider.apisev.cn
加入合法request
域名列表如果需要下載視頻功能的話,把https://v6-ppx.ixigua.com
加入downloadFile
合法域名列表樣式基于colorui
,請在全局或者組件樣式文件內引入colorui
3.組件引入并使用
組件建議在一個空白頁面進行引入,配置json
文件
"navigationStyle": "custom"http://自定義需要配置的內容
或者也可以在全局引入該配置
"window": { "navigationStyle": "custom" }
2.全局引入組件并使用
"usingComponents": { "spider":"components/spider/spider" }
在頁面中使用組件
<!--么錯,就是這么簡單--> <spider> </spider>
4.API構建思路
- 根據(jù)短鏈接請求的
response
溯源視頻的item_id
信息 - 配置合理的
header
置換真實的視頻地址 - 根據(jù)
item_id
請求api
置換無水印視頻地址 - 請求結果存放在緩存中,如果短時間內有類似查詢,可以迅速返回結果
age = 3600 * 24
不提供接口源碼,不做盈利使用,僅供皮友們學習娛樂
5.去水印插件
loading
動畫,可以使用 wx.showLoading
來替代
spider.js
// components/spider/spider.js Component({ options: { addGlobalClass: true, multipleSlots: true }, /** * 組件的屬性列表 */ properties: { }, /** * 組件的初始數(shù)據(jù) */ data: { url:'', vis:false, mname:'', videourl:'' }, /** * 組件的方法列表 */ methods: { hideModal(e) { this.setData({ mname: null }) }, urlinput(e){ this.setData({ url:e.detail.value }) }, parse(){ var url = this.data.url; this.setData({vis:true}) wx.request({ url: 'https://spider.apisev.cn/cvideo/v1/pipixia?url='+url, success:res=>{ console.log(res) this.setData({ vis:false, mname:'bt', videourl:res.data.videourl }) }, fail:res=>{ console.log(res) } }) } } })
spider.wxml
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}"> <view slot="backText">返回</view> <view slot="content">去水印解析</view> </cu-custom> <view class="cu-form-group margin-top"> <textarea maxlength="-1" disabled="{{modalName!=null}}" bindinput="urlinput" placeholder="請輸入視頻鏈接"></textarea> </view> <view class="padding flex flex-direction"> <button class="cu-btn bg-green margin-tb-sm lg" bindtap="parse">解析</button> </view> <uload visible="{{vis}}" text="正在解析" > </uload> <view class="cu-modal bottom-modal {{mname=='bt'?'show':''}}"> <view class="cu-dialog"> <view class="cu-bar bg-white"> <view class="action text-green">下載</view> <view class="action text-blue" bindtap="hideModal">關閉</view> </view> <view class="padding-xl"> <video src="{{videourl}}" ></video> </view> </view> </view>
參考文檔
CVideo 接口文檔 皮皮蝦無水印接口V1 - CVideo接口文檔 - 飛光 (apisev.cn)
到此這篇關于微信小程序-基于ColorUI構建皮皮蝦短視頻去水印組件(僅供學習使用)的文章就介紹到這了,更多相關微信小程序短視頻去水印內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
JS使用遮罩實現(xiàn)點擊某區(qū)域以外時彈窗的彈出與關閉功能示例
這篇文章主要介紹了JS使用遮罩實現(xiàn)點擊某區(qū)域以外時彈窗的彈出與關閉功能,結合實例形式分析了javascript事件響應及頁面元素屬性動態(tài)操作彈出與關閉遮罩層相關實現(xiàn)技巧,需要的朋友可以參考下2018-07-07httpclient模擬登陸具體實現(xiàn)(使用js設置cookie)
最簡單的方法就是通過得到的cookie定制一個httpclient,感興趣的朋友可以了解下本文2013-12-12