Samsung / cordova-plugin-toast

Cordova plugin that provides TV Specific functionalities.
Apache License 2.0
122 stars 60 forks source link

How to test application with an HLS(m3u8) stream #44

Open AlinaDovbysheva opened 7 years ago

AlinaDovbysheva commented 7 years ago

Hello.

Please, could you tell how to test application with an HLS(m3u8) stream? I use the toast.MediaPluginHLS:

var drmOptions = window.getMediaOption(); var mediaPlugin = new toast.MediaPluginHLS(drmOptions);

media.resetPlugin(); media.attachPlugin(mediaPlugin); media.open(' http://.../playlist.m3u8'); Thanks. Alina

yongjuYoon commented 7 years ago

Hello,

The codes that you write are in here?

If so, did you make "deviceinfo.js" and include in index.html?

AlinaDovbysheva commented 7 years ago

Hi, Yes, I did deviceinfo.js and include in index.html in media.js: media = toast.Media.getInstance(); var drmOptions = window.getMediaOption(); var mediaPlugin = new toast.MediaPluginHLS(drmOptions); media.resetPlugin(); media.attachPlugin(mediaPlugin); media.open('http://.../playlist.m3u8'); mediaContainer = media.getContainerElement(); document.body.appendChild(mediaContainer); media.syncVideoRect(); addControlBar(); media.play();

Then "cordova emulate browser" in chrome At step var mediaPlugin = new toast.MediaPluginHLS(drmOptions); code stops working

yongjuYoon commented 7 years ago

Hi,

Unfortunatly, some media formats(.ts, .m3u8, etc.) are not supported on browser(based Chrome).

On chrome browser, TOAST uses Video tag.

So formats to be supported on Video tag are supported.

Thank you.

AlinaDovbysheva commented 7 years ago

Hello, Please help with two questions 1) Сode stops working at step var mediaPlugin = new toast.MediaPluginHLS(drmOptions); before the media.open('http://.../playlist.m3u8'); Maybe I need include some js? 2) How to test the application for Tizen, orsay and tv-webos?

Thank you.

yongjuYoon commented 7 years ago

Hello, @AlinaDovbysheva

1. This plugin supported special content(adaptive streaming / DRM) playback with option data in TOAST. This plugin defines a toast.MediaPlugin Constructor.

But in browser, that media contents are not supported on browser(based Chrome). Accordingly we don't support this in browser.

So.. there is no constructor and ones be related to toast.MediaPlugin in browser platform. It is that a procedure stops at before media.open above reason.

2. We support that plugin in the others(tizen, orsay, tv-webos). You can find the answer in a under link. https://github.com/Samsung/cordova-plugin-toast/blob/master/docs/toast.MediaPlugin.md#examples

RafaelMagalhaesN commented 7 years ago

I have problems with hls. I tested the simulator and the stream works ok. But in WebOS does not run the stream, could you help me?

capscrom commented 7 years ago

Hi, @RafaelMagalhaesN Do you mean that you have problem in WebOS TV? How about WebOS emulator? is it OK?

RafaelMagalhaesN commented 7 years ago

Hello everyone. Sorry for delay to answer. I changed my stream url from .m3u8(Hls, not working in LG WebOS emulator, but in TV it's OK. idk reason) to .acc (works in LG/Samsung emulator and TV's). I tested .mp3 type too, and works great (LG/Samsung TV and WebOS emulator/Samsung simulator)