Unable to change the playhead location using Samsung AVPlay API

冷暖自知 提交于 2020-01-05 04:11:10

问题


I have a typescript/javascript Tizen Web App running in a Samsung Smart TV Emulator v5.0. Using the Samsung AVPlay API. The web app plays an MPEG streaming video source from an HDHomeRun device. The video plays perfectly with sound.

The problem is, none of the playhead changing functions work. i.e seek, jumpBackward, jumpForward etc. The all give me the same error "InvalidStateError: PLAYER_ERROR_INVALID_STATE" even though the state is valid "PLAYING, PAUSED or READY".

Here is a code snippet:

var state = webapis.avplay.getState();
console.log("[Player][seekBackward] state: ", state);

webapis.avplay.jumpBackward(5000, success =>
{
    console.log("[Player][rewind][success]");
}, error =>
{
    console.error("[Player][seekBackward]", error);
});

Here is the resulting error in the console when I call this:

Any ideas on what can I can do to get the jumpBackward and other playhead functions to work?


回答1:


I checked: with AVPlay wgt , with the URL [http://168.219.241.217/fileshare/AVPlayTest/WebAPITest/Basic/Youtube.mp4] , seek and jumpfw functionality working fine. but above url internal to samsung, i think that is not accessible outside samsung.

I didn't meet the problem as you, but basing on my experience you should check:

  • problem 1,may possible with different content , it may related to specific content. its better if get played content url and wgt used, please attach if possible.



回答2:


var state = webapis.avplay.getState();
console.log("[Player][seekBackward] state: ", state);

if (state == "PLAYING" || state == "PAUSED")
{
   webapis.avplay.jumpBackward(5000, success =>
   {
     console.log("[Player][rewind][success]");
   }, error =>
   {
    console.error("[Player][seekBackward]", error);
   });
}

Try this, you must check player state(PLAYING or PAUSED) before forward and rewind media.

It may be helpful for you.



来源:https://stackoverflow.com/questions/58548191/unable-to-change-the-playhead-location-using-samsung-avplay-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!