How to disable menu button press in TVML?

266 Views Asked by At

How to disable menu button press in TVML? For some scenarions in my project,like while playing Ads in video, I dont want user to skip it by pressing menu button.I did not see any solution on internet. Please help.

function loadingDoc() {                                     
var Template =  `
 <document>
    <divTemplate>
        <title style="tv-position: bottom-right;">1/1</title>
    </divTemplate>
</document>`

var templateParser = new DOMParser();
parsedTemplate = templateParser.parseFromString(Template, "application/xml");
parsedTemplate.addEventListener("disappear", highlightThumbnail.bind(this));
player.interactiveOverlayDocument = parsedTemplate;
player.interactiveOverlayDismissable = true;

}

var highlightThumbnail = function (event){
    loadingDoc();
}
1

There are 1 best solutions below

2
kaho On

Two solutions that might work are:

1) Native + TVML: find the topmost view controller as mentioned in iPhone -- How to find topmost view controller and apply UITapGestureRecognizer to it.

2) TVML only: with interactiveOverlayDismissable and interactiveOverlayDocument, you can push another overlay document when the user dismisses the current one. Thus-- they will never be able to menu out.