9***@qq.com
9***@qq.com
  • 发布:2021-08-27 13:31
  • 更新:2022-06-02 17:40
  • 阅读:910

【报Bug】ios端video组件播放rtmp的直播流地址,连接蓝牙耳机依旧扬声播放,音频里只有iphone设备。

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows7 旗舰版 Service Pack 1

HBuilderX类型: 正式

HBuilderX版本号: 3.2.3

手机系统: iOS

手机系统版本号: IOS 14

手机厂商: 苹果

手机机型: iphone xsMax,iphone11,iphone12

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view>  
        <video id="myVideo" ref="myVideo" class="myVideo" :style="'width:'+windowWidth+'px;height:'+windowHeight+'px'"  
            :autoplay="true" :src="liveUrl" :muted="muted" :controls='false' :object-fit="objectFit">  
        </video>  
          
    </view>  
</template>  
  
<script>  
    import http from '@/utils/request.js'  
    export default {  
        data() {  
            return {  
                windowHeight: 0,  
                windowWidth: 0,  
                btnTop:60,  
                btnButtom:800,  
                dmButtom:0,  
                ftbot:230,  
                muted:false,  
                liveUrl:"",  
                liveList:'',  
                liveState:'START',  
                objectFit:'cover',  
            }  
        },  
        onLoad(options) {  
			console.log('进入页面')  
			// 点播地址  
            this.liveUrl = 'http://video.xmhhtkd.cn/10%E5%BC%80%E5%8F%91%E9%99%A2%E7%AC%AC%E5%8D%81%E5%A5%97.mp4';  
            // 直播地址  
            this.liveUrl = 'rtmp://media3.scctv.net/live/scctv_800'  
              
            // 苹果安卓适配  
            if(uni.getSystemInfoSync().platform=='ios'){  
                this.objectFit = 'fill';  
            }  
            else{  
                this.objectFit = 'cover';  
            }  
              
              
        },  
        onShow(){  
            this.btnTop = uni.getSystemInfoSync().statusBarHeight+6;  
            this.btnButtom = uni.getSystemInfoSync().windowHeight-66  
            this.dmButtom = uni.getSystemInfoSync().windowHeight-346;  
            this.windowWidth = uni.getSystemInfoSync().windowWidth  
            this.windowHeight = uni.getSystemInfoSync().windowHeight  
        },  
        onReady: function(res) {  
            this.videoContext = uni.createVideoContext('myVideo', this)  
        },  
        methods: {  
              
  
        }  
    }  
</script>  
  
<style>  
      
</style>

操作步骤:

进入页面使用点播地址播放,声音播放为已连接的音频设备,进入页面使用直播地址播放,声音播放为扬声

预期结果:

进入页面播放直播地址,ios系统和android系统一致默认使用已连接的蓝牙设备播放,音频设备里会显示已连接的蓝牙耳机设备

实际结果:

ios系统播放直播地址,已连接上的蓝牙耳机,在蓝牙里是显示已连接,但音频里没有连接的蓝牙耳机。

bug描述:

ios端nvue页面,video组件播放rtmp的直播流地址,使用蓝牙耳机连接后依旧扬声播放,音频里已连接的蓝牙耳机消失,使用m3u8的直播流地址点播地址可以蓝牙播放,音频里已连接的蓝牙会显示。使用有线耳机时无论是点播和直播都会通过耳机播放。蓝牙耳机使用的是AirPods,AirPods Pro。有线耳机通过3.5mm转接头接入小米,苹果原装的有线耳机。(测试方式:MAC打包自定义基座真机调试,实机安装测试环境证书传统打包的app)

2021-08-27 13:31 负责人:iOS_DJX 分享
已邀请:
Chandre

Chandre

同样的问题,ios15 基座3.2.9版本,rtmp与flv的直播流都无法使用蓝牙耳机播放

5***@qq.com

5***@qq.com

3.2.16还是有同样的问题

7***@qq.com

7***@qq.com

遇到了同样的问题顶一下

趣品

趣品

同问,没什么解决办法

_孙大圣_

_孙大圣_ - 只想用nvue

同问,要解决方法吗

Leonw2229

Leonw2229

这玩意是没人处理了算是,这么久了还没修

iOS_DJX

iOS_DJX

再提供一个可以 播放的rtmp 我来跟进

DCloud_UNI_Anne

DCloud_UNI_Anne

HBuilderX alpha 3.4.13 已修复

要回复问题请先登录注册