Saikat Debnath
Saikat Debnath

Reputation: 1

Implementing multitasking for Samsung Tizen TV

we are developing an samsung tizen os app. i found out that multitaking feature is a mandatory to publish the app. there were docs regarding the implementation of multitaking but i could not find it helpful there So if there is a way to implement multitaking then how should i do it can anybody here explain me in simple language here so that we can submit our app for QA. Thank you in advance

Upvotes: 0

Views: 768

Answers (1)

LadyBo
LadyBo

Reputation: 145

Basically, you need to make changes in your config.xml file and in your JS code.

Here can find Samsung Sample, that demonstrates how you can implement multitasking when using the AVPlay API. - https://github.com/SamsungDForum/PlayerAVPlayMultitasking

  1. Changes in config.xml. Add line

    <tizen:metadata key="http://samsung.com/tv/metadata/multitasking.support" value="true"/>

  2. Listeners in your app

         /**
          * Enable multitasking
          */
         document.addEventListener("visibilitychange",function(){
             //When going away from this app suspend player
             if( document.hidden ){ // PAUSE
                 player.suspend();
             } else { // RESUME
                 //When going back to this app resume player
                 player.resume();
             }
         }); 
    
    .....
    
     /**
      * Suspend playback for multitasking
      */
     suspend: function () {
         webapis.avplay.pause();
         webapis.avplay.suspend();
     },
    
     /**
      * resume playback for multitasking
      */
     resume: function () {
         webapis.avplay.restore();
         webapis.avplay.play();
     },
    

Upvotes: 0

Related Questions