我需要播放mp4视频,视频源在我的云服务器上。我尝试使用视频标签来播放
<video></video>
,视频正在正常播放。但是当我尝试使用 AVPlay API 时,在调用准备时会抛出错误 PLAYER_ERROR_CONNECTION_FAILED 。这是我的代码
webapis.avplay.open("https://preskripsi.com/assets/net.mp4");
webapis.avplay.setDisplayRect(0, 0, 1920, 1080);
webapis.avplay.setDisplayMethod(
"PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO"
);
webapis.avplay.setListener(listener);
webapis.avplay.prepareAsync(function () {
webapis.avplay.play();
});
我已将其放在 config.xml 中,但它仍然无法正常工作
<access origin="*" subdomains="true"></access>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/tv.window"/>
我尝试将其放在 config.xml 上
<tizen:privilege name="http://developer.samsung.com/privilege/avplay" />
但仍然无法工作
请帮助我,谢谢。
示例代码看起来不错。 我没有遇到像你这样的问题,但根据我的经验,看起来是环境问题,可能是网络问题。 您还可以使用 Sample AVPLAY wgt 检查您的内容: https://github.com/SamsungDForum/PlayerAVPlay/blob/master/PlayerAVPlay/