微信小程序基于ColorUI構(gòu)建皮皮蝦短視頻去水印組件
沒(méi)錯(cuò),我是皮友,我想學(xué)習(xí)舞蹈(/doge)和瑜伽 ,要無(wú)水印的那種有助于我加深學(xué)習(xí)。
1.組件效果展示
2.組件引入準(zhǔn)備
https://spider.apisev.cn
加入合法request
域名列表如果需要下載視頻功能的話,把https://v6-ppx.ixigua.com
加入downloadFile
合法域名列表樣式基于colorui
,請(qǐng)?jiān)谌只蛘呓M件樣式文件內(nèi)引入colorui
3.組件引入并使用
組件建議在一個(gè)空白頁(yè)面進(jìn)行引入,配置json
文件
"navigationStyle": "custom"http://自定義需要配置的內(nèi)容
或者也可以在全局引入該配置
"window": { "navigationStyle": "custom" }
2.全局引入組件并使用
"usingComponents": { "spider":"components/spider/spider" }
在頁(yè)面中使用組件
<!--么錯(cuò),就是這么簡(jiǎn)單--> <spider> </spider>
4.API構(gòu)建思路
- 根據(jù)短鏈接請(qǐng)求的
response
溯源視頻的item_id
信息 - 配置合理的
header
置換真實(shí)的視頻地址 - 根據(jù)
item_id
請(qǐng)求api
置換無(wú)水印視頻地址 - 請(qǐng)求結(jié)果存放在緩存中,如果短時(shí)間內(nèi)有類似查詢,可以迅速返回結(jié)果
age = 3600 * 24
不提供接口源碼,不做盈利使用,僅供皮友們學(xué)習(xí)娛樂(lè)
5.去水印插件
loading
動(dòng)畫(huà),可以使用 wx.showLoading
來(lái)替代
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="請(qǐng)輸入視頻鏈接"></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">關(guān)閉</view> </view> <view class="padding-xl"> <video src="{{videourl}}" ></video> </view> </view> </view>
參考文檔
CVideo 接口文檔 皮皮蝦無(wú)水印接口V1 - CVideo接口文檔 - 飛光 (apisev.cn)
到此這篇關(guān)于微信小程序-基于ColorUI構(gòu)建皮皮蝦短視頻去水印組件(僅供學(xué)習(xí)使用)的文章就介紹到這了,更多相關(guān)微信小程序短視頻去水印內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
javascript 模式設(shè)計(jì)之工廠模式詳細(xì)說(shuō)明
2010-05-05JS基于VML技術(shù)實(shí)現(xiàn)的五角星禮花效果代碼
這篇文章主要介紹了JS基于VML技術(shù)實(shí)現(xiàn)的五角星禮花效果代碼,涉及JavaScript數(shù)學(xué)運(yùn)算與頁(yè)面元素動(dòng)態(tài)操作的相關(guān)技巧,需要的朋友可以參考下2015-10-10javascript 保存文件到本地實(shí)現(xiàn)方法
本文將提供兩種方式保存圖片,大家可以根據(jù)喜歡自由選擇2012-11-11JS使用遮罩實(shí)現(xiàn)點(diǎn)擊某區(qū)域以外時(shí)彈窗的彈出與關(guān)閉功能示例
這篇文章主要介紹了JS使用遮罩實(shí)現(xiàn)點(diǎn)擊某區(qū)域以外時(shí)彈窗的彈出與關(guān)閉功能,結(jié)合實(shí)例形式分析了javascript事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)操作彈出與關(guān)閉遮罩層相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-07-07httpclient模擬登陸具體實(shí)現(xiàn)(使用js設(shè)置cookie)
最簡(jiǎn)單的方法就是通過(guò)得到的cookie定制一個(gè)httpclient,感興趣的朋友可以了解下本文2013-12-12