小程序使用的蜻蜓FM提供的一个rtmp格式的音频直播流,经过测试在android手机上没有问题,可以正常播放音频直播,但是在ios设备上不能播放音频。地址:
rtmp://220.249.108.56/live/aa
直播代码段:
<live-player muted="false" class='audio_live' src="rtmp://220.249.108.56/live/aa" id="player"mode="live" autoplay='true' bindstatechange="statechange" binderror="error" />
1、在4G模式是不会自动播放的,要切换到wifi下才会自动播放。
2、ios版本的live-player跟android版本有一些差异。你打开真机调试看看信息
我看返回的statechange的状态码跟Android的都是一样的。但是Android的就能正常的播放。
live-player code: 2007
audio.js? [sm]:52 live-player code: 2008
audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2001
audio.js? [sm]:52 live-player code: 2002
audio.js? [sm]:68 play success
18audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2002
audio.js? [sm]:52 live-player code: 2004
audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2007
39audio.js? [sm]:52 live-player code: 200
audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2007
39audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 3005
8audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2103
2audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2001
audio.js? [sm]:52 live-player code: 2002
20audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2002
146audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 3005
7audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2103
2audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2001
audio.js? [sm]:52 live-player code: 2002
17audio.js? [sm]:52 live-player code: 2005
audio.js? [sm]:52 live-player code: 2002
30audio.js? [sm]:52 live-player code: 2005
之前我们遇到的问题是拉流的时候,ios版本的展示样式中有一种方式不对,切换一种就可以看了。