Samsung / cordova-plugin-toast

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

Media inputDevice #39

Closed guipdutra closed 7 years ago

guipdutra commented 7 years ago

Hello, I'm trying to mapping the keys around the media(MediaPlayPause, MediaStop, MediaPlay, ... )

But I noticed that in Orsay(tvKeyCode.MediaPlay) and Tizen(tvKeyCode.KEY_PLAY) the keys are different. There is any abstraction from toast for this difference be transparent for me and I do not have to use "If this platform use this key".

yongjuYoon commented 7 years ago

Hello, @guipdutra

We expect, you may be trying to mapping the keys by using "TizenKeyValue.js"

But from now on, you do not need to be so, because we provide that in TOAST.

If you check the media sample app OR drmmedia sample app, you can get the answer which you want.

Thank you.

guipdutra commented 7 years ago

Hello, @yongjuYoon

Thank you for you answer.

Using the same code in the example works perfeclty in Orsay and webOS. But in Tizen did not work, because the key of MediaPlay in Tizen is KEY_PLAY and do not get mapped.

My question is should I put the KEY_PLAY in usedKeys variable?

var usedKeys = [
        'MediaPause',
        'MediaPlay',
        'MediaFastForward',
        'MediaRewind',
        'MediaStop'
        'KEY_PLAY'
    ];
yongjuYoon commented 7 years ago

Hi,

The keycode of KEY_PLAY in 'TizenTVKeyValue.js' is 415.

It means that MediaPlay and KEY_PLAY is the same meaning. And in TOAST, we provide this role as the mediaplay key.

So you can use the MediaPlay key in place of KEY_PLAY.

Also you can check the value of 'KEY_PLAY' in TizenTVKeyValue.js' at the SDsite

Thank you.