Skip to content

Commit

Permalink
feat: ✨ Swiper 轮播视频支持控制静音播放和循环播放 (#855)
Browse files Browse the repository at this point in the history
Closes: #846
  • Loading branch information
Moonofweisheng authored Jan 18, 2025
1 parent 21fbfbb commit 7a0d5ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/component/swiper.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ const isLoop = ref(false)
| text-key | 选项对象中,标题 text 对应的 key | `string` | - | `text` | 1.3.13 |
| adjust-height | 自动以指定滑块的高度为整个容器的高度。当 vertical 为 true 时,默认不调整,仅支付宝小程序支持。| `string` | `'first' \| 'current' \| 'highest' \| 'none'` | `highest` | 1.3.13 |
| adjust-vertical-height | vertical 为 true 时强制使 adjust-height 生效。仅支付宝小程序支持。 | `boolean` | - | `false` | 1.3.13 |
| muted | 视频是否静音播放 | `boolean` | - | `true` | $LOWEST_VERSION$ |
| videoLoop | 视频是否循环播放 | `boolean` | - | `true` | $LOWEST_VERSION$ |



Expand Down
14 changes: 14 additions & 0 deletions src/uni_modules/wot-design-uni/components/wd-swiper/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ export const swiperProps = {
*/
loop: makeBooleanProp(true),

/**
* 视频是否循环播放
* 类型:boolean
* 默认值:true
*/
videoLoop: makeBooleanProp(true),

/**
* 视频是否静音播放
* 类型:boolean
* 默认值:true
*/
muted: makeBooleanProp(true),

/**
* 后边距
* 类型:number 或 string(数字或可转换为数字的字符串)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
@play="handleVideoPaly"
@pause="handleVideoPause"
:enable-progress-gesture="false"
loop
muted
:loop="videoLoop"
:muted="muted"
:autoplay="autoplayVideo"
objectFit="cover"
@click="handleClick(index, item)"
Expand Down

0 comments on commit 7a0d5ce

Please sign in to comment.