h5视频落地页知识点整理
创始人
2024-03-22 03:42:25
0

一、视频在苹果中自动播放(借助微信SDK)

1.引入微信SDK

2.    

document.addEventListener('WeixinJSBridgeReady', function() {

        const timer = setInterval(() => {

        WeixinJSBridge.call('hideOptionMenu')

        console.log('hideoptionmenu')

        const videoPlayer = document.querySelector(`#videoele`)

        if (videoPlayer && videoPlayer.play && isIos) {

            clearInterval(timer)

            vue.isPlaying = true

            videoPlayer.play()

        }

        }, 300)

    })

二、 h5页面中视频禁止默认播放器,希望在页面内播放

x5-video-player-type="h5-page" :show-fullscreen-btn="false" 两个属性

   

三、openinstall

h5中调起苹果的应用商店下载app,和安卓直接下载

1.在mounted中初始化openinstall

            initOpeninstall() {

                const that = this

                // if (that.getOS() === 'ios') return

                const s = document.createElement('script')

                s.type = 'text/javascript'

                s.src = 'https://web.cdn.openinstall.io/openinstall.js' // 在线引用

                s.onload = function () {

                    // @ts-ignore

                    const data = OpenInstall.parseUrlParams() // openinstall.js中提供的工具函数,解析url中的所有查询参数

                    // @ts-ignore

                    that.install = new OpenInstall({

                    /* appKey必选参数,openinstall平台为每个应用分配的ID */

                    appKey: that.installAppKey,

                    /* 自定义遮罩的html */

                    //mask: function(){

                    // return "

"

                    //},

                    /* OpenInstall初始化完成的回调函数,可选 */

                    onready: function() {

                        /*在app已安装的情况尝试拉起app*/

                        // m.schemeWakeup();

                        /*用户点击某个按钮时(假定按钮id为downloadButton),安装app*/

                        // eslint-disable-next-line

                        // const m = this

                        // const button = document.getElementById('downloadButton')

                        // function wakeup() {

                        //   m.wakeupOrInstall({data})

                        //   return false

                        // }

                        // if (button) button.onclick = wakeup

                    },

                    }, data)

                }

                document.head.appendChild(s)

            },

2.触发下载事件时

const data = OpenInstall.parseUrlParams() // openinstall.js中提供的工具函数,解析url中的所有查询参数

this.install.wakeupOrInstall({data})

效果:

 

 

相关内容

热门资讯

【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
ChatGPT 怎么用最新详细... ChatGPT 以其强大的信息整合和对话能力惊艳了全球,在自然语言处理上面表现出了惊人...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...