Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
uniapp_vedio
Commits
7d3346d1
Commit
7d3346d1
authored
Dec 19, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
81606868
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
977 additions
and
339 deletions
+977
-339
episode-popup.vue
vedio/components/episode-popup/episode-popup.vue
+107
-0
index.vue
vedio/components/home/index.vue
+16
-12
uni-popup.vue
vedio/components/uni-popup/uni-popup.vue
+0
-4
uni-transition.vue
vedio/components/uni-transition/uni-transition.vue
+0
-281
share.js
vedio/mixins/share.js
+1
-14
pages.json
vedio/pages.json
+29
-28
ttVideoDetail.vue
vedio/pagesC/ttvideo/ttVideoDetail.vue
+645
-0
index.js
vedio/ttcomponents/video-player/index.js
+139
-0
index.json
vedio/ttcomponents/video-player/index.json
+6
-0
index.ttml
vedio/ttcomponents/video-player/index.ttml
+29
-0
index.ttss
vedio/ttcomponents/video-player/index.ttss
+5
-0
No files found.
vedio/components/episode-popup/episode-popup.vue
0 → 100644
View file @
7d3346d1
<
template
>
<view>
<uni-popup
type=
"bottom"
ref=
"select"
>
<view
:style=
"'width: '+ windowWidth +'px;height:860rpx;background-color: #202020; border-radius:20rpx 20rpx 0 0;'"
>
<view
style=
"height: 70rpx;display: flex; flex-direction: row;align-items: center;"
>
<image
src=
"@/static/video/layers.png"
style=
"width: 40rpx; height: 40rpx; margin-left: 20rpx;"
/>
<view
:style=
"'font-size: 30rpx; font-weight: bold; color: #FFFFFF; margin-left: 20rpx; overflow: hidden;'"
>
当前播放第
{{
Number
(
originIndex
+
1
)
}}
集
</view>
<image
@
click=
"down"
src=
"@/static/video/down.png"
style=
"width: 50rpx; height: 50rpx; margin:0 20rpx 0 auto; "
>
</image>
</view>
<u-tabs
v-if=
"showTab"
:current=
"myTabIndex"
:list=
"tabs"
@
change=
"popHandleChange"
lineWidth=
"30"
lineColor=
"#f56c6c"
:activeStyle=
"
{
color: '#f56c6c',
fontWeight: 'bold',
transform: 'scale(1.05)'
}" :inactiveStyle="{
color: '#ffffff',
transform: 'scale(1)'
}">
</u-tabs>
<swiper
class=
"swiper mt-20"
@
change=
"popSwiperChange"
:current=
"myTabIndex"
:vertical=
"false"
circular
>
<swiper-item
v-for=
"(list, index1) in subList"
:key=
"index1"
>
<scroll-view
:style=
"'width: '+ (windowWidth) +'px; height: '+ ((windowHeight/1.6)*0.85) +'px;'"
:scroll-y=
"true"
>
<view
class=
"flex space"
style=
"display:flex; flex-wrap:wrap;"
>
<block
v-for=
"(list,index2) in subList[index1]"
>
<view
@
click
.
stop=
"selectThisVideo(index2 + (index1%30*30))"
style=
"position: relative;width:16%;height: 120rpx; background: gray;border-radius: 10rpx;margin-left: 5rpx;margin-bottom: 5rpx;"
>
<image
v-if=
"originList[
(index1 == 0 ? index2 : (index2 + (index1%30*30)))
].lock"
src=
"@/static/video/lock.png"
style=
"width:30rpx;height:30rpx;position:absolute;right:5rpx;top:5rpx;"
/>
<view
class=
"flex"
style=
"width:100%;height:100%;align-items:center;justify-content:center;"
>
<text
v-if=
"(originIndex+1)==list.vedioIndex"
style=
"font-size: 36rpx;color: #f56c6c;"
>
{{
list
.
vedioIndex
}}
</text>
<text
v-else
style=
"font-size: 36rpx;color: #FFFFFF;"
>
{{
list
.
vedioIndex
}}
</text>
</view>
<image
v-if=
"(originIndex+1)==list.vedioIndex"
src=
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_playing.gif"
style=
"width:30rpx;height:30rpx;position:absolute;left:5rpx;bottom:5rpx;"
/>
</view>
</block>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</uni-popup>
</view>
</
template
>
<
script
>
export
default
{
name
:
'episodePopup'
,
props
:
{
windowWidth
:
Number
,
windowHeight
:
Number
,
originIndex
:
Number
,
tabIndex
:
Number
,
tabs
:
Array
,
subList
:
Array
,
originList
:
Array
,
},
data
()
{
return
{
myTabIndex
:
this
.
tabIndex
,
showTab
:
false
};
},
methods
:
{
show
()
{
this
.
$refs
.
select
.
open
();
this
.
showTab
=
true
},
popHandleChange
(
event
)
{
this
.
myTabIndex
=
event
.
index
},
popSwiperChange
(
event
)
{
const
{
current
}
=
event
.
detail
;
this
.
myTabIndex
=
current
},
down
()
{
this
.
$refs
.
select
.
close
();
},
selectThisVideo
(
index
)
{
this
.
$emit
(
'selectVideo'
,
index
);
this
.
$refs
.
select
.
close
();
}
}
}
</
script
>
<
style
>
.swiper
{
width
:
100%
;
height
:
100%
;
}
</
style
>
\ No newline at end of file
vedio/components/home/index.vue
View file @
7d3346d1
...
...
@@ -310,17 +310,21 @@
}
});
},
handleBanner
(
item
)
{
navigateTo
(
`/pagesC/video/newVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleInfo
(
item
)
{
navigateTo
(
`/pagesC/video/newVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleTop
(
item
)
{
navigateTo
(
`/pagesC/video/newVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleBottomPlay
(
item
)
{
navigateTo
(
`/pagesC/video/newVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
handleBanner
(
item
)
{
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleInfo
(
item
)
{
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleTop
(
item
)
{
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleBottomPlay
(
item
)
{
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
)));
},
handleBottomClose
()
{
this
.
newRecordBean
=
null
;
...
...
@@ -351,7 +355,7 @@
data
})
=>
{
if
(
data
.
vedioMsg
!=
null
)
{
navigateTo
(
`/pagesC/
video/new
VideoDetail?data=`
+
navigateTo
(
`/pagesC/
ttvideo/tt
VideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
data
.
vedioMsg
)));
}
...
...
vedio/components/uni-popup/uni-popup.vue
View file @
7d3346d1
...
...
@@ -11,7 +11,6 @@
</view>
</
template
>
<
script
>
import
uniTransition
from
'@/components/uni-transition/uni-transition.vue'
/**
* PopUp 弹出层
* @description 弹出层组件,为了解决遮罩弹层的问题
...
...
@@ -27,9 +26,6 @@
export
default
{
name
:
'UniPopup'
,
components
:
{
uniTransition
},
props
:
{
// 开启动画
animation
:
{
...
...
vedio/components/uni-transition/uni-transition.vue
deleted
100644 → 0
View file @
81606868
<!-- 底部弹窗需要组件(分享) -->
<
template
>
<view
v-if=
"isShow"
ref=
"ani"
class=
"uni-transition"
:class=
"[ani.in]"
:style=
"'transform:' +transform+';'+stylesObject"
@
click=
"change"
>
<slot></slot>
</view>
</
template
>
<
script
>
// #ifdef APP-NVUE
const
animation
=
uni
.
requireNativePlugin
(
'animation'
);
// #endif
/**
* Transition 过渡动画
* @description 简单过渡动画组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
* @value fade 渐隐渐出过渡
* @value slide-top 由上至下过渡
* @value slide-right 由右至左过渡
* @value slide-bottom 由下至上过渡
* @value slide-left 由左至右过渡
* @value zoom-in 由小到大过渡
* @value zoom-out 由大到小过渡
* @property {Number} duration 过渡动画持续时间
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
*/
export
default
{
name
:
'uniTransition'
,
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
},
modeClass
:
{
type
:
Array
,
default
()
{
return
[]
}
},
duration
:
{
type
:
Number
,
default
:
300
},
styles
:
{
type
:
Object
,
default
()
{
return
{}
}
}
},
data
()
{
return
{
isShow
:
false
,
transform
:
''
,
ani
:
{
in
:
''
,
active
:
''
}
};
},
watch
:
{
show
:
{
handler
(
newVal
)
{
if
(
newVal
)
{
this
.
open
()
}
else
{
this
.
close
()
}
},
immediate
:
true
}
},
computed
:
{
stylesObject
()
{
let
styles
=
{
...
this
.
styles
,
'transition-duration'
:
this
.
duration
/
1000
+
's'
}
let
transfrom
=
''
for
(
let
i
in
styles
)
{
let
line
=
this
.
toLine
(
i
)
transfrom
+=
line
+
':'
+
styles
[
i
]
+
';'
}
return
transfrom
}
},
created
()
{
// this.timer = null
// this.nextTick = (time = 50) => new Promise(resolve => {
// clearTimeout(this.timer)
// this.timer = setTimeout(resolve, time)
// return this.timer
// });
},
methods
:
{
change
()
{
this
.
$emit
(
'click'
,
{
detail
:
this
.
isShow
})
},
open
()
{
clearTimeout
(
this
.
timer
)
this
.
isShow
=
true
this
.
transform
=
''
this
.
ani
.
in
=
''
for
(
let
i
in
this
.
getTranfrom
(
false
))
{
if
(
i
===
'opacity'
)
{
this
.
ani
.
in
=
'fade-in'
}
else
{
this
.
transform
+=
`
${
this
.
getTranfrom
(
false
)[
i
]}
`
}
}
this
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
this
.
_animation
(
true
)
},
50
)
})
},
close
(
type
)
{
clearTimeout
(
this
.
timer
)
this
.
_animation
(
false
)
},
_animation
(
type
)
{
let
styles
=
this
.
getTranfrom
(
type
)
// #ifdef APP-NVUE
if
(
!
this
.
$refs
[
'ani'
])
return
animation
.
transition
(
this
.
$refs
[
'ani'
].
ref
,
{
styles
,
duration
:
this
.
duration
,
//ms
timingFunction
:
'ease'
,
needLayout
:
false
,
delay
:
0
//ms
},
()
=>
{
if
(
!
type
)
{
this
.
isShow
=
false
}
this
.
$emit
(
'change'
,
{
detail
:
this
.
isShow
})
})
// #endif
// #ifndef APP-NVUE
this
.
transform
=
''
for
(
let
i
in
styles
)
{
if
(
i
===
'opacity'
)
{
this
.
ani
.
in
=
`fade-
${
type
?
'out'
:
'in'
}
`
}
else
{
this
.
transform
+=
`
${
styles
[
i
]}
`
}
}
this
.
timer
=
setTimeout
(()
=>
{
if
(
!
type
)
{
this
.
isShow
=
false
}
this
.
$emit
(
'change'
,
{
detail
:
this
.
isShow
})
},
this
.
duration
)
// #endif
},
getTranfrom
(
type
)
{
let
styles
=
{
transform
:
''
}
this
.
modeClass
.
forEach
((
mode
)
=>
{
switch
(
mode
)
{
case
'fade'
:
styles
.
opacity
=
type
?
1
:
0
break
;
case
'slide-top'
:
styles
.
transform
+=
`translateY(
${
type
?
'0'
:
'-100%'
}
) `
break
;
case
'slide-right'
:
styles
.
transform
+=
`translateX(
${
type
?
'0'
:
'100%'
}
) `
break
;
case
'slide-bottom'
:
styles
.
transform
+=
`translateY(
${
type
?
'0'
:
'100%'
}
) `
break
;
case
'slide-left'
:
styles
.
transform
+=
`translateX(
${
type
?
'0'
:
'-100%'
}
) `
break
;
case
'zoom-in'
:
styles
.
transform
+=
`scale(
${
type
?
1
:
0.8
}
) `
break
;
case
'zoom-out'
:
styles
.
transform
+=
`scale(
${
type
?
1
:
1.2
}
) `
break
;
}
})
return
styles
},
_modeClassArr
(
type
)
{
let
mode
=
this
.
modeClass
if
(
typeof
(
mode
)
!==
"string"
)
{
let
modestr
=
''
mode
.
forEach
((
item
)
=>
{
modestr
+=
(
item
+
'-'
+
type
+
','
)
})
return
modestr
.
substr
(
0
,
modestr
.
length
-
1
)
}
else
{
return
mode
+
'-'
+
type
}
},
// getEl(el) {
// console.log(el || el.ref || null);
// return el || el.ref || null
// },
toLine
(
name
)
{
return
name
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
}
}
}
</
script
>
<
style
>
.uni-transition
{
transition-timing-function
:
ease
;
transition-duration
:
0.3s
;
transition-property
:
transform
,
opacity
;
}
.fade-in
{
opacity
:
0
;
}
.fade-active
{
opacity
:
1
;
}
.slide-top-in
{
/* transition-property: transform, opacity; */
transform
:
translateY
(
-100%
);
}
.slide-top-active
{
transform
:
translateY
(
0
);
/* opacity: 1; */
}
.slide-right-in
{
transform
:
translateX
(
100%
);
}
.slide-right-active
{
transform
:
translateX
(
0
);
}
.slide-bottom-in
{
transform
:
translateY
(
100%
);
}
.slide-bottom-active
{
transform
:
translateY
(
0
);
}
.slide-left-in
{
transform
:
translateX
(
-100%
);
}
.slide-left-active
{
transform
:
translateX
(
0
);
opacity
:
1
;
}
.zoom-in-in
{
transform
:
scale
(
0.8
);
}
.zoom-out-active
{
transform
:
scale
(
1
);
}
.zoom-out-in
{
transform
:
scale
(
1.2
);
}
</
style
>
vedio/mixins/share.js
View file @
7d3346d1
// export default {
// created() {
// //#ifdef MP-WEIXIN
// wx.showShareMenu({
// withShareTicket: true,
// menus: ['shareAppMessage', 'shareTimeline']
// });
// //#endif
// },
// }
export
default
{
data
()
{
return
{
share
:
{
title
:
'更多好剧,等你来看'
,
imageUrl
:
'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_movie.png'
,
path
:
'/pages/loading?shareId='
// path: '/pages/loading?shareId=' + getApp().globalData.userId,
path
:
'/pages/loading?shareId='
}
}
},
...
...
vedio/pages.json
View file @
7d3346d1
...
...
@@ -13,7 +13,7 @@
"path"
:
"pages/loading"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#F2F1FF"
,
"navigationBarBackgroundColor"
:
"#F2F1FF"
,
"navigationBarTextStyle"
:
"#000000"
}
},
...
...
@@ -22,14 +22,14 @@
"path"
:
"pages/home"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"#000000"
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"#000000"
}
},
...
...
@@ -37,35 +37,35 @@
"path"
:
"pages/my/my"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"#000000"
}
},
{
"path"
:
"pages/brower/brower"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
}
},
{
"path"
:
"pages/recommend/recommend"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"#ffffff"
}
},
{
"path"
:
"pages/recommend/follow"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"#000000"
}
},
{
"path"
:
"pages/recommend/recommendVideo"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"#ffffff"
}
}
...
...
@@ -84,17 +84,17 @@
},
{
"root"
:
"pagesC"
,
"pages"
:
[{
"path"
:
"
video/v
ideoDetail"
,
"path"
:
"
ttvideo/ttV
ideoDetail"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"#ffffff"
}
},
{
"path"
:
"video/newVideoDetail"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"#ffffff"
}
}]
...
...
@@ -102,31 +102,31 @@
"root"
:
"pagesD"
,
"pages"
:
[{
"path"
:
"watchRecord/watchRecord"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"观看记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
}
},
{
"path"
:
"payRecord/payRecord"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"我的订单"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
}
},
{
"path"
:
"dotRecord/dotRecord"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"看点记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
}
},
{
"path"
:
"useDotRecord/useDotRecord"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"消费记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
...
...
@@ -139,16 +139,17 @@
//
当我们进入了pages/home页面以后就会预下载pagesA分包
"pages/home"
:
{
"network"
:
"all"
,
//在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages"
:
[
"pagesA"
]
//进入页面后预下载分包
},
"pages/recommend/recommend"
:
{
"network"
:
"all"
,
//在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages"
:
[
"pagesC"
]
//进入页面后预下载分包
},
"pages/my/my"
:
{
"network"
:
"all"
,
//在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages"
:
[
"pagesD"
]
//进入页面后预下载分包
}
"packages"
:
[
"pagesA"
,
"pagesC"
,
"pagesD"
]
//进入页面后预下载分包
}
//
,
//
"pages/recommend/recommend"
:
{
//
"network"
:
"all"
,
//在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
//
"packages"
:
[
"pagesC"
]
//进入页面后预下载分包
//
},
//
"pages/my/my"
:
{
//
"network"
:
"all"
,
//在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
//
"packages"
:
[
"pagesD"
]
//进入页面后预下载分包
//
}
},
"globalStyle"
:
{
"backgroundColor"
:
"#232325"
,
...
...
vedio/pagesC/
video/v
ideoDetail.vue
→
vedio/pagesC/
ttvideo/ttV
ideoDetail.vue
View file @
7d3346d1
This diff is collapsed.
Click to expand it.
vedio/ttcomponents/video-player/index.js
0 → 100644
View file @
7d3346d1
// 自定义组件参考:https://mp.kuaishou.com/docs/develop/frame/custom_comp/component_constructor.html
// video 参考:https://bytedance.larkoffice.com/docx/TsJmdbX6co33uJxi7j9cfYc2nnd
Component
({
// 外部样式属性定义,其实也就是把内部需要外部支持的 class 名称放这里导出
// 在外部直接使用导出的名称字段关联即可,可以同时导出多个,这里是数组 ['','',...]
externalClasses
:
[
'inner-class'
],
// 对内参数
data
:
{
},
// 对外参数(prop)
properties
:
{
// 内部样式
innerStyle
:
{
type
:
String
,
value
:
''
},
// 唯一标识符
id
:
{
type
:
String
,
value
:
''
},
// 原片id
albumId
:
{
type
:
String
,
value
:
''
},
// 剧集id
episodeId
:
{
type
:
String
,
value
:
''
},
// 废弃字段。为了兼容老版本,请传 1
version
:
{
type
:
String
,
value
:
'1'
},
// 使用cdn类型,1: 抖音云 2: 三方云
cloudType
:
{
type
:
Number
,
value
:
1
},
// 播放地址,cloudType 为 2 时生效,传入第三方播放地址 http://vjs.zencdn.net/v/oceans.mp4
src
:
{
type
:
String
,
value
:
''
},
// 自动播放
autoplay
:
{
type
:
Boolean
,
value
:
false
},
// 显示默认播放控件(播放/暂停按钮、播放进度、时间)
controls
:
{
type
:
Boolean
,
value
:
true
},
// 循环播放
loop
:
{
type
:
Boolean
,
value
:
false
},
// 静音播放
muted
:
{
type
:
Boolean
,
value
:
false
},
// 指定视频初始播放位置
initialTime
:
{
type
:
Number
,
value
:
0
},
// 指定视频时长
duration
:
{
type
:
Number
,
value
:
0
},
// 'contain' | 'fill' | 'cover'
objectFit
:
{
type
:
String
,
value
:
'contain'
},
// 若不设置,宽度大于 240 时才会显示
showProgress
:
{
type
:
Boolean
,
value
:
true
},
// 是否显示全屏按钮
// 在同层渲染模式下仅支持控制竖屏状态(非全屏)下的「全屏按钮」的显示,横屏状态(全屏)不显示「退出全屏按钮」,只能通过标题旁边的箭头退出全屏
showFullscreenBtn
:
{
type
:
Boolean
,
value
:
true
},
// 是否显示视频底部控制栏的播放按钮
showPlayBtn
:
{
type
:
Boolean
,
value
:
true
},
// 是否开启控制进度的手势
enableProgressGesture
:
{
type
:
Boolean
,
value
:
true
},
// 是否显示静音按钮
showMuteBtn
:
{
type
:
Boolean
,
value
:
false
}
},
methods
:
{
// 加载 ref
refHandler
(
ref
)
{
this
.
triggerEvent
(
'ref'
,
ref
)
},
// 当开始/继续播放时触发 play 事件
handlePlay
(
e
)
{
this
.
triggerEvent
(
'play'
,
e
)
},
// 当暂停播放时触发 pause 事件
handlePause
(
e
)
{
this
.
triggerEvent
(
'pause'
,
e
)
},
// 当播放到末尾时触发 ended 事件
handleEnded
(
e
)
{
this
.
triggerEvent
(
'ended'
,
e
)
},
// 播放进度变化时触发,event.detail = {currentTime, duration} 。触发频率 250ms 一次
handleTimeupdate
(
e
)
{
this
.
triggerEvent
(
'timeupdate'
,
e
)
},
// 视频进入和退出全屏时触发,event.detail = {fullScreen, direction},direction 有效值为 vertical 或 horizontal
handleFullscreenchange
(
e
)
{
this
.
triggerEvent
(
'fullscreenchange'
,
e
)
},
// 视频播放出错时触发
handleError
(
e
)
{
this
.
triggerEvent
(
'error'
,
e
)
}
}
})
\ No newline at end of file
vedio/ttcomponents/video-player/index.json
0 → 100644
View file @
7d3346d1
{
"component"
:
true
,
"usingComponents"
:
{
"video-player"
:
"ext://industry/video-player"
}
}
\ No newline at end of file
vedio/ttcomponents/video-player/index.ttml
0 → 100644
View file @
7d3346d1
<video-player
id="{{ id }}"
tt:ref="refHandler"
class="video-player-view inner-class"
style="{{ innerStyle }}"
album-id="{{ albumId }}"
episode-id="{{ episodeId }}"
version="{{ version }}"
cloud-type="{{ cloudType }}"
three-party-cloud="{{ src }}"
autoplay="{{ autoplay }}"
controls="{{ controls }}"
loop="{{ loop }}"
muted="{{ muted }}"
initial-time="{{ initialTime }}"
duration="{{ duration }}"
object-fit="{{ objectFit }}"
show-progress="{{ showProgress }}"
show-fullscreen-btn="{{ showFullscreenBtn }}"
show-play-btn="{{ showPlayBtn }}"
enable-progress-gesture="{{ enableProgressGesture }}"
show-mute-btn="{{ showMuteBtn }}"
bindplay="handlePlay"
bindpause="handlePause"
bindended="handleEnded"
bindtimeupdate="handleTimeupdate"
bindfullscreenchange="handleFullscreenchange"
binderror="handleError"
></video-player>
\ No newline at end of file
vedio/ttcomponents/video-player/index.ttss
0 → 100644
View file @
7d3346d1
/* 兼容 uniapp 第三方混编使用,不需要可移除,详细查看 README.md */
.video-player-view {
width: 100%;
height: 100%;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment