小程序
小游戏
企业微信
微信支付
扫描小程序码分享
请登录“同框相册”小程序首页,在“精彩内容”中任选一个视频,播放视频,然后退出视频界面,出现微信闪退。
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),以及描述一下具体的复现流程,可以提供复现的视频看看(可上传至腾讯视频)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),以及描述一下具体的复现流程,可以提供复现的视频看看(可上传至腾讯视频)。
const app = getApp()
Page({
data: {
cos_large_image_url: '封面图片链接',
cos_original_image_url:'视频链接',
},
onLoad: function () {
console.log('代码片段是一种迷你、可分享的小程序或小游戏项目,可用于分享小程序和小游戏的开发经验、展示组件和 API 的使用、复现开发问题和 Bug 等。可点击以下链接查看代码片段的详细文档:')
console.log('https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html')
},
previewMedia: function (event) {
console.info(event);
var sources = [];
sources[sources.length] = {
url: this.data.cos_original_image_url,
type: "video",
poster: this.data.cos_large_image_url,
}
console.info(sources);
wx.previewMedia({
current: 0,
sources: sources,
complete: function (res) {
console.info(res);
}
});
},
})
index.wxml:
<view>
<view class='browserviewitem'>
<image class='browserviewitem-img' src='{{cos_large_image_url}}' lazy-load='{{true}}' mode='widthFix'></image>
<image class='video' src="/resource/orgvideo/orgvideo-675.png" bindtap='previewMedia'></image>
</view>
</view>
index.wxss:
.intro {
margin: 30px;
text-align: center;
}
.video{
position:absolute;
width:675rpx;
height:200rpx;
top:0;
left:0;
margin: 0;
}