更新记录

1.0.6(2024-06-04)

  • 兼容uniapp-x资源加载问题

1.0.5(2024-04-08)

  • 兼容uvue-ios

1.0.4(2024-03-01)

  • 支持uvue
查看更多

平台兼容性

HbuilderX/cli最低兼容版本
3.7.0

uni-app

Vue2 Vue3
?
app-vue app-nvue app-android app-ios
? ? ? ?
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
? ? ? ? ? ? ? ? ?
微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序 钉钉小程序 快手小程序 飞书小程序 京东小程序
? ? ? ? ? ? ? ? ?
快应用-华为 快应用-联盟
? ?

uni-app x

app-android app-ios
? ?
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
? ? ? ? ? ? ? ? ?

sn-uts-pag

sn-uts-page组件是uts组件,实现了pag的ios、android封装

注意

  • sn-uts-pag仅App端nvue页面支持
  • App-Android平台要求Android5(API Leavel 21)及以上系统
  • App-iOS平台要求iOS11及以上版本系统

属性说明

属性 类型 默认值 说明
path string '' pag文件地址
repeatCount string 1 重复播放次数

事件说明

  • end

    播放结束

方法说明

  • replay

    重播

  • pause

    暂停

  • isPlaying

    是否正在播放

    • nvue
    this.$refs.pag.isPlaying(e => {
        console.log('isPlaying', e == true ? 'true' : 'false')
    })
    • uvue
    const el = this.$refs["pag"] as SnUtsPagElement
    console.log('isPlaying', el.isPlaying())

代码示例

<template>
    <view>
        <sn-uts-pag ref="pag" path="/static/0.pag" @end="onEnd"
            style="width: 300rpx;height: 200rpx;background-color: antiquewhite;" />
        <button type="default" @click="play">play</button>
        <button type="default" @click="pause">pause</button>
        <button type="default" @click="checkPlay">检查是否在播放</button>
    </view>
</template>

<script>
    export default {
        data() {
            return {

            }
        },
        methods: {
            onEnd() {
                console.log('play end')
            },
            play() {
                this.$refs.pag.replay()
            },
            pause() {
                this.$refs.pag.pause();
            },
            checkPlay() {
                this.$refs.pag.isPlaying((e) => {
                    console.log('isPlaying', e == true ? 'true' : 'false');
                });
            }
        }
    }
</script>

<style>

</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问