|
@@ -10,20 +10,28 @@ Component({
|
|
|
this.setData({
|
|
|
worksListCopy: newVal
|
|
|
})
|
|
|
- this._observer = this.createIntersectionObserver({
|
|
|
- observeAll: true
|
|
|
- })
|
|
|
- this._observer.relativeTo('.playLine')
|
|
|
- .observe('.videoPreview', (res) => {
|
|
|
- let intersectionRatio = res.intersectionRatio
|
|
|
- if (intersectionRatio > 0) {
|
|
|
- this.setData({
|
|
|
- currentId: res.dataset.id
|
|
|
- })
|
|
|
- }
|
|
|
+ if (this.properties.autoPlay) {
|
|
|
+ // 自动播放
|
|
|
+ this._observer = this.createIntersectionObserver({
|
|
|
+ observeAll: true
|
|
|
})
|
|
|
+ this._observer.relativeTo('.playLine')
|
|
|
+ .observe('.videoPreview', (res) => {
|
|
|
+ let intersectionRatio = res.intersectionRatio
|
|
|
+ if (intersectionRatio > 0) {
|
|
|
+ this.setData({
|
|
|
+ currentId: res.dataset.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ // 是否自动播放
|
|
|
+ autoPlay: {
|
|
|
+ type: Boolean,
|
|
|
+ value: true
|
|
|
+ },
|
|
|
videoType: {
|
|
|
type: String,
|
|
|
// value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,collection为收藏时的样式,excellent优秀作品展播
|