pansyjs / react-components

React components library.
https://react-components-vert.vercel.app
MIT License
34 stars 5 forks source link

播放器默认播放为静音,如何解决? #115

Closed yangchangming closed 1 year ago

yangchangming commented 1 year ago

加载视频成功后,默认为静音状态,如何进行设置?谢谢! 我用的版本是1.3.0 配置如下:

<Player source={currentPlayUrl} ref={playerRef} options={{ autoplay: true, height: '500px', preload: true, isLive: false }} />

wangxingkang commented 1 year ago

ref.setVolume(0.5)

wangxingkang commented 1 year ago

要不升级下版本吧 新版本就是 ref 引用变动 其他都没变化

yangchangming commented 1 year ago

谢谢回答! 升级到最新版,但是报另外一个错误,就是类型错误什么的,我看了一下vue版本有类似的错误,好像是说外层div id的什么问题,我没有解决!

yangchangming commented 1 year ago

报错信息如下! Uncaught TypeError: 没有为播放器指定容器

wangxingkang commented 1 year ago

提供个最小复现吧

hanwenbo commented 1 year ago

@wangxingkang 直播场景用ref设置声音 在pc的web下会暂停 提示: Unmuting failed and the element was paused instead because the user didn't interact with the document before

do play aliplayer-min.js:2 do play failed

wangxingkang commented 1 year ago

@yangchangming @pansy/react-aliplayer: 2.1.0 => 2.1.1