|
@@ -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,
|
|
|
|