Manuel_Rodrigues Manuel_Rodrigues - 1 month ago 16
Javascript Question

Samsung Smart TV App in eclipse

I'm developing an app for an Samsung Smart TV, and I need to redirect the tv content (TV channel) to a especifique position on the screen.

This is my code to resizing the tv content

var tvWindowObject = window.webapis.tv.window;

function resizeTvScreen(){
tvWindowObject.getAvailableWindow(availableWindowSuccess, availableWindowFailure)
}

function availableWindowSuccess(){
resizeTvWindowView();
}

var tvSpecs = {
width : 400,
height : 400,
left : 0,
bottom : 0
};
var sourceInfo = {
type : tvWindowObject. SOURCE_MODE_TV,
number : 0
}

function resizeTvWindowView(){
var result = tvWindowObject.setRect(tvSpecs, 1);

if(result == true){
tvWindowObject.setSource(sourceInfo, setSourceSuccess, setSourceFailure);
}else{
alert('TV resize function failur');
}
}


My problem is that the TV channel dose not resize. The TV content only shows in the desired position but the channel appears cut in the screen.

How can I redirect the TV channel window to my desired position?

Answer

I have solved my problem with the example project from this link:

https://www.samsungdforum.com/SamsungDForum/ForumView/df3455b529adf7c4?forumID=a1eb19cf9d64ad4a