reason:
公司做課程直播,也就是直播講課,但是只有音頻直播沒有視頻。
need:
在微信端上能自動播放直播流(m3u8),隱藏播放器(因為要看互動聊天信息)。
question:
如果用`<video>`標簽來拉流的話,是可以播放的,基本上都能播放,但是**不能自動播放**,而且**會全屏**
如果用`<audio>`標簽只能兼容部分android版本手機,基本試了市面上的大部分播放器,基本也是這兩個問題:
會全屏,不能自動播放,但是其他公司就能達到我們想要的效果,比如:蜻蜓什么的fm平臺,就想問問有沒有
大神給支個招,怎么解決這個問題???
Current solution:
判斷已知機型來決定用video還是用audio,但這不是解決辦法??!
求指教
閉關修行中......
Video seems to be full screen only in WeChat. You need to add an inline element in the video tag to prevent full screen. It seems like this:
<video src="" webkit-playsinline playsinline></video>
As for automatic playback, you need to write a compatibility statement to distinguish between opening in WeChat and opening in a browser. For WeChat, you need to call their jssdk interface. There is no need to fill in the parameters, just add one sentence:
wx.config({
debug: false,
appId: '',
timestamp:1,
nonceStr: '',
signature: '',
jsApiList: []
});
wx.ready(function(){
video.play();
});
It seems like this should be enough