SamsungDForum / PlayerAVPlaySubtitle

Sample applications for subtitle feature
Other
14 stars 2 forks source link

cannot display subtitle when play dash link #1

Open kevinbol opened 5 years ago

kevinbol commented 5 years ago

test link: https://vm2.dashif.org/dash/vod/testpic_2s/cea608_and_segs.mpd

there is no subtitle display when play this link, while works for hls link.

pwsses commented 5 years ago

This Sample Application for External Subtitle contents. I think, test link content has internal subtitle. So you need some modify in main.js code

kevinbol commented 5 years ago

yes, it is internal subtitle. could you give a code sample for implement internal subtitle?

pwsses commented 5 years ago

It is simple. Just add onsubtitlechange listener on setListener before prepare. ex) var listener = { onsubtitlechange: function(duration, text, type, attriCount, attributes) { console.log(text) } }

webapis.avplay.close(); webapis.avplay.open(videoURL); webapis.avplay.setListener(listener); webapis.avplay.prepare(); webapis.avplay.setDisplayRect(0,0,1920,1080); //check your window size. webapis.avplay.play();

kevinbol commented 5 years ago

yes, it is just same as external subtitle, the difference is that it doesn't need the download code. but, no subtitle display at my side. is there any other place which may should be modified?

pwsses commented 5 years ago

No that is all. I tested your contents and I received text on console.log. check on onsubtitlechange function by console.log.

kevinbol commented 5 years ago

please excuse me for troubling you. but I did not received the onsubttilechange event when play this dash linkl. I test it on 2017 and 2018 smart TV, all failed. in fact, I have look over much samsung specific about subtitle implement, and webvtt subtitle of hls link works. I cannot get any clue about why it doesn't works for dash link.

kevinbol commented 5 years ago

is there any setting on the TV system?

pwsses commented 5 years ago

Can U share your sample code to me? I will check it.

kevinbol commented 5 years ago

forTry.wgt.zip I used this code, which is cloned from yours.

kevinbol commented 5 years ago

I use my own certificate to build it, does it cause the issue?

pwsses commented 5 years ago

No your code has some problem, your video has internal subtitle but you try external subtitle which is 'http://yt.sweet.tv/VTTConverter/78/820876311/original_ro_0.vtt' And the value of downloaded subtitle path is wrong. you must using filesystem for path.

In case of Internal subtitle content, just simple.

function test0() { try { webapis.avplay.close(); webapis.tvinfo.registerInAppCaptionControl(true); webapis.tvinfo.showCaption(true); webapis.avplay.open(videoURL); webapis.avplay.setListener(listener); webapis.avplay.prepare(); var AVPlayer = document.getElementById('av-player'); webapis.avplay.setDisplayRect(AVPlayer.offsetLeft, AVPlayer.offsetTop, AVPlayer.offsetWidth, AVPlayer.offsetHeight); webapis.avplay.play(); } catch(e) { console.log('test0 throw exception : ' + JSON.stringify(e)); } }

kevinbol commented 5 years ago

thank you very much. after modifying it according to your guide, TTML and CC subtitle can display on 2018 Smart TV. but still cannot display on 2016 Smart TV. what the difference on 2016 TV? official document declare it supports TTML and CC since 2016 TV

kevinbol commented 5 years ago

hi, does 2016 TV support TTML and CC internal subtitle of dash link ?

pwsses commented 5 years ago

Hi. As I know, avplay spec is same between 2016 and 2019. But if your 2016 Smart TV doesn't display that, you should ask to samsung develpor site. (https://developer.samsung.com/home.do)

kevinbol commented 5 years ago

ok, thanks

octadevtn commented 2 years ago

tizen 6.0 and tizen 6.5 subtitle included in video mkv cannot get truck text subtitle we get only truck audio and video