top

Implementing PiP

Samsung TV for Tizen platform supports PiP. This document covers the basic features of PiP and its implementation.

Overview

PiP means source(such as TV channel, HDMI and etc) is displayed on application.

Dependencies

Depending on the model of Samsung TV, PiP is supported or not.
Please refer to the following table.

Product Support Model
Samsung TV All of 2015 Samsung TV models onwards
Samsung TV SDK Version 2.1.2 onwards

Implementation

Making PiP

  • You can make PiP by calling tizen.tvwindow.show method.

    tizen.tvwindow.show(
    	function(success){
    		console.log('success');
    	},
    	function(fail){
    		console.log('fail');
    	},
    	['0px', '0px', '50%', '540px'],
    	'MAIN',
    );
    
    Note

    All elements on PiP disappear.

  • For hiding PiP, please call tizen.tvwindow.hide method.

    tizen.tvwindow.hide(
    	function(success){
    		console.log('success');
    	},
    	function(fail){
    		console.log('fail');	
    	}
    );
    

Controlling TV Channel

TV channel can be controlled only by calling tizen.tvchannel API, not channel key of remote controller.

tizen.tvchannel.tuneUp(
	function(success){
		console.log('success');
	},
	function(fail){
		console.log('fail');
	},
	'ALL'
);

If you want to know more information for tvchannel, please refer to TVChannel API

Note

Channel banner UI doesn’t appear on application.
You can make it with HTML element independently.

Controlling Audio

Audio volume of PiP can be controlled by both volume key of remote controller and tizen.tvaudiocontrol API.

tizen.tvaudiocontrol.setVolumeUp();

If you want to know more information for tvchannel, please refer to TVAudioControl API

Setting config.xml

To call these API, you should declare privilege in “config.xml” as follows.

<tizen:privilege name="http://tizen.org/privilege/tv.window"/>
<tizen:privilege name="http://tizen.org/privilege/tv.channel"/>
<tizen:privilege name="http://tizen.org/privilege/tv.audio"/>

Changing TV Source

Source of PiP can be changed by calling tizen.tvwindow.setSource method.

tizen.systeminfo.getPropertyValue(
	'VIDEOSOURCE', 
	function(videoSource) {
		console.log('success');

		var connectedVideoSources = videoSource.connected;
		for (var i = 0; i < connectedVideoSources.length; i++) {
			if (connectedVideoSources[i].type === 'HDMI') {
				tizen.tvwindow.setSource(
					connectedVideoSources[i],
					function(success){
						console.log('success');
					},
					function(fail){
						console.log('fail');
					});
				break;
			}
		}
	},
	function(fail){
		console.log('fail');
	}
);