Create individual pages inside of a client-server app using Apple TV Markup Language (TVML).

Posts under TVML tag

16 Posts

Post

Replies

Boosts

Views

Activity

How to Display Multiple Fields in a User Registration Form Using TVML for Apple TV?
Hello, I am currently developing an application for Apple TV using TVML, and I am trying to create a user registration or login form with multiple input fields (e.g., "Username" and "Password"). However, I am facing issues with displaying multiple textField components in the formTemplate. Here are the approaches I have tried: Attempt 1: <document> <formTemplate> <banner> <title>Login</title> </banner> <banner> <textField>UserName</textField> </banner> <banner> <textField>Password</textField> </banner> <footer> <button id="button1"> <text>Button 1</text> </button> </footer> </formTemplate> </document> Attemp 2: <document> <formTemplate> <banner> <title>Login</title> </banner> <textField>UserName</textField> <textField>Password</textField> <footer> <button id="button1"> <text>Button 1</text> </button> </footer> </formTemplate> </document> In both cases, the layout does not render the fields as expected. Either the textField components do not display at all, or the structure seems incorrect. Could someone please guide me on the proper way to display multiple textField components in a formTemplate? Is there a limitation or specific requirement for structuring these elements? Thank you in advance for your assistance!
0
0
603
Jan ’25
TVML apps cause memory leaks
Hi all ! I have been working a while in this issue , first i started instrumenting our product trying to remove all dependency that can be causing retain memory until the app source only contains the AppDelegate and the TVApplicationController delegates implementation loading the TVML App and the Javascript context. After that i just realise that any TVOS app using TVMLKit retain memory without cause and that eventually will provoque a CRASH exception because the device it will run outs memory. I realise that by implementing a Hello World TVML App and doing MemoryLeaks instrument measurements and is imposible to know where is the source of this memory retentions when the app start. ** For the folks of Apple Developer Technical Support (DTS) : ** Case ID : 3279774 Apple Feedback link : https://feedbackassistant.apple.com/feedback/12540693 Anyone else seeing this issue? We have all our customers impacted by this problem
0
0
737
Aug ’23
TVML Player JS start playing delay content behind the current LIVE timestamp
Hi all ! I have been working a while on this problem . Turns out some of our customers when playing LIVE HLS content through a TVML Application using the standard Player JS API , for some channels the content start playing 5 mins before live timestamp witch is an unexpected behavior using this Player API. As a developer , i took the channels customer content and implement 2 Sample tvOS Apps : By using Fairplay + AVPlayerController , all native implementation and the issue is not reproducible . By using FairPlay + Player JS API , a TVML Sample implementation and the issue i always reproducible. **For the folks of Apple Developer Technical Support (DTS) : ** Case ID : 3280424 Apple Feedback link : https://feedbackassistant.apple.com/feedback/12565232 Anyone else seeing this issue?
0
0
756
Aug ’23
TVML Basic and Technical Questions from TVML Rookie
Hi Guys, I did lot of iOS, tvOS and macOS developemnt with UIKit and SwiftUI, but TVML appears to have really steep learning curve. When searching online and in this forum, posts are 7 years old and most often there are no replies. Is TVML something already obsolete and abandoned by Apple? Does it make sense to try quickly building streaming app using TVML? Is it better to start in SwiftUI and build templates from scratch and forget about TVML? What's nice that I can quickly build a page with collections of videos, however I struggle for several hours to do the simplest thing like adding a simple element with title, subtitle and play button. Why this doesn't display anything inside stackTemplate? <banner> <stack> <title>My Title</title> </stack> </banner> Why this doesn't display anything inside stackTemplate? <collectionList> <shelf id="row0"> <section binding="items:{videos}"> <prototypes> <lockup prototype="play" videoURL="https://storage.googleapis.com/media-session/sintel/trailer.mp4" > <title style="margin: 20; color: white; font-size: 60" binding="textContent:{title}"/> </lockup> </prototypes> </section> </shelf> If I add image to the loclkup element, it works and displays image and title. But if I want to add only title and subtitle and play button, it doesn't work. Is img manadatory inside lockup element? In documentation I cannot find, which subelement is mandatory and which is optional. Why cannot I add stack element as a prototype into the section element? Although I'm a native developer and don't really like HTML, I thought that TVML works in a similar way and I can add almost any element into any other element, like building HTML and TVML platform will stack up UI elements based on that. However it appears to be severely limited. Rules for even a basic element inside another layout element are so strict that I cannot tell ahead if it's going to work. Why doesn't it at least display elements that are defined correctly? Usually when one of the elements is invalid, then the whole section or shelf or container in general is hidden from view. It's impossible to build UI from the ground up. For example I thought I could add lockup element with title, see how it looks, than add subtitle and continue adding elements one by one. However if lockup with title simply doesn't display at all, I cannot figure out what's wrong, there is no error message in the console. Documentation is insufficient, it's not possible to figure out from that how each TVML UI elements works, what's mandatory and what's optional, sometimes I was actually add element inside another element even though docs didn't say it's possible. Like adding stack to some element, which I no longer rememeber. Is it possible to debug TVML somehow? Is it possible to debug JS in Xcode? Is there any TVML preview like in case of xib or SwiftUI? So far I always have to rebuild the app and look in the simulator screen. But often it caches the results and I have to delete the app from simulator, clean the build and rebuild again. It's very time consuming. Is there nay way to clear the cache (hot key)? Thanks.
0
1
1.1k
Jul ’23
Cannot play videos on tvOS 16.
What is causing the problem with the app and how should I approach the solution? I have taken over the development of a video viewing application that runs on tvOS. Recently, a user reported that he could not play videos on tvOS 16. I built the application in xcode and tried to play the video on tvOS 16.4 in simulator. Then a symbol similar to 🚫 appeared on the video player and the video could not be played. UIKit and TVML Kit JS are used in the source code. Video source is HLS with H.264 codec When playback failed, Xcode displayed the following error message. 023-05-26 12:59:58.477905+0900 hoge_tvOS[35421:14197398] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x6000007080a0 H:|-(95)-[UIStackView:0x155247910] (active, names: '|':UIView:0x155247770 )>", "<NSLayoutConstraint:0x6000007082d0 UIStackView:0x155247910.trailing == UIView:0x155247770.trailing - 95 (active)>", "<NSLayoutConstraint:0x6000007f38e0 H:|-(0)-[UIView:0x155247770] (active, names: '|':_AVFocusContainerView:0x151d431f0 )>", "<NSLayoutConstraint:0x6000007f3930 UIView:0x155247770.trailing == _AVFocusContainerView:0x151d431f0.trailing (active)>", "<NSLayoutConstraint:0x60000070b1b0 '_UITemporaryLayoutWidth' _AVFocusContainerView:0x151d431f0.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x6000007082d0 UIStackView:0x155247910.trailing == UIView:0x155247770.trailing - 95 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. I have confirmed in the past that it can be played on tvOS 14. Thanks for reading.
0
3
979
Jul ’23
How often does Apple gets data from universal search feed that I am proving for my app
How frequently does Apple retrieve data from my provided Universal Search feed API and how often do they refresh their data? I am inquiring about both VOD and live content. Regarding live content, is it only necessary to provide an availability feed, or should both an availability feed and content feed be provided for VOD?
0
0
1k
Apr ’23
tvOS Info Panel Metadata
Hi, I’m looking to see if it is possible to add a png image or any other rating icon to the content rating metadata as Apple TV has for the rotten tomatoes (🍅 66%) as an example in parentheses. I could not find an answer anywhere in Apple dev documents, I’m looking to add this to my application. Please clarify if it’s even possible.
0
0
890
Apr ’23
TVOS TVML XMLHttpRequest memory leak crashes application
I have a simple TVML app that displays shop-floor status data, the JS hits a webservice every 60 seconds and pulls an updated TVML string and loads it to the DOM. It works great for about 4 hours then crashes due to a memory leak caused by XMLHttpRequest not being deposed of properly. I've tried various ways to release the object, but nothing seems to have any affect. Any suggestions? Apple TV device log error is: 90 seconds cpu time over 90 seconds (100% cpu average), exceeding limit of 50% cpu over 180 seconds App.onLaunch = function (options) { var ip = options.IP; var refreshRate = options.REFRESH_RATE; //reload js every 15 minutes setTimeout(function () { App.reload() }, 900000); //refresh at passed in interval setInterval(function () { getTemplate(ip) }, refreshRate); loadingMessage(ip); getTemplate(ip); } function pushDoc(doc) { if (doc != null) { navigationDocument.clear(); navigationDocument.pushDocument(doc); } } function getTemplate(ip) { try { var url = "http://GetTemplate?ip=" + ip; var request = new XMLHttpRequest(); request.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { pushDoc(request.responseXML); delete request; request = null; } }; request.responseType = "document"; request.open("GET", url); request.send(); } catch (err) { errorMessage(ip, "getTemplate()", err.message) } } function loadingMessage(ip) { var loadingString = "<?xml version='1.0' encoding='UTF-8' ?>"; loadingString += "<document>"; loadingString += "<alertTemplate>"; loadingString += "<title>IP: " + ip + " - " + now() + "</title>"; loadingString += "<description>Loading...</description>"; loadingString += "</alertTemplate>"; loadingString += "</document>"; var loading = new DOMParser(); var doc = loading.parseFromString(loadingString, "application/xml"); pushDoc(doc); } function errorMessage(ip, func, err) { var errorString = "<?xml version='1.0' encoding='UTF-8' ?>"; errorString += "<document>"; errorString += "<alertTemplate>"; errorString += "<title>IP: " + ip + " - " + now() + "</title>"; errorString += "<description>" + func + " failed! Error is: " + err + "</description>"; errorString += "</alertTemplate>"; errorString += "</document>"; var error = new DOMParser(); var doc = error.parseFromString(errorString, "application/xml"); pushDoc(doc); } function now() { var currentdate = new Date(); var datetime = ((currentdate.getMonth() + 1) < 10 ? '0' : '') + (currentdate.getMonth() + 1) + "/" + (currentdate.getDate() < 10 ? '0' : '') + currentdate.getDate() + "/" + currentdate.getFullYear() + " @ " + (currentdate.getHours() < 10 ? '0' : '') + currentdate.getHours() + ":" + (currentdate.getMinutes() < 10 ? '0' : '') + currentdate.getMinutes() + ":" + (currentdate.getSeconds() < 10 ? '0' : '') + currentdate.getSeconds(); return datetime; }
0
0
1.2k
May ’22
Trigger formTemplate Button from iPhone enter
I have a formTemplate and when the user starts typing, the keyboard opens on the iPhone for faster typing. How can I make the button in the formTemplate triggered by the iphone enter button? Is there any eventListener or similar? function emailTemplate() { var template = "<document><formTemplate><banner><description>Enter email for access</description></banner><textField id='email' keyboardType='emailAddress'>Your email</textField><footer><button><text>Submit</text></button></footer></formTemplate></document>"; // var parser = new DOMParser(); // var doc = parser.parseFromString(template , "application/xml"); var templateParser = new DOMParser(); var parsedTemplate = templateParser.parseFromString(template, "application/xml"); var loading = loadingTemplate(); loadingScreen); pushPage(parsedTemplate, loading); var email = parsedTemplate.getElementById("email"); parsedTemplate.addEventListener("select", function() { submit(email); }); } function submit(textField) { var keyboard = textField.getFeature('Keyboard'); var email = keyboard.text; if (isValidEmailAddress(email)) { localStorage.setItem("email", email); initPage(); } else { console.log("amail is not valid"); } }
1
0
825
Mar ’22
Exception from TVML Background Audio tvOs15 - AVPlayerPlaybackCoordinator
When we add a background audio element in tvOs v15 it generates the exception below: Exception            NSException *    "*** -[AVPlayerPlaybackCoordinator setFigPlaybackCoordinator:] invalid parameter not satisfying: figPlaybackCoordinator != NULL"  0x00006000010d16e0 Below is our TVML: <?xml version="1.0" encoding="UTF-8" ?> <document> <head> <style> * { <!-- To cutomize the interval image is displayed on screen --> tv-transition-interval:8.0; } </style> </head> <mainTemplate> <background> <img src="{{ our server }}/temp/AppleTvProto1/splash.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_1.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_2.jpg" /> <audio> <asset id="main_audio" src="{{ our server }}/temp/AppleTvProto1/background.mp3" /> </audio> </background> <menuBar> <section> <menuItem onselect="getDocument('/appletv-live')"> <title>Live</title> </menuItem> <menuItem onselect="getDocument('/appletv-messages')"> <title>Messages</title> </menuItem> <menuItem onselect="getDocument('/appletv-music')"> <title>Music</title> </menuItem> </section> </menuBar> </mainTemplate> </document>
4
0
1.5k
Feb ’22
pages crash
Hello, I have a problem with the text editor pages, if I have a object that I added with the "+" button that is on the right top of the screen. then if I try to write any texte that isn't in a object, the program will crash. I only have this bug since yesterday. tanks for reading my bug report
0
0
534
Jan ’22
Client-server TVML App Sample Code crashes
Hi there, I just downloaded the Sample Code provided by de developer documentation in order to run a simple Client-Server app with TVML Kit for tvOS. https://developer.apple.com/documentation/tvmljs/creating_a_client-server_tvml_app I'm following the docs step by step and after running the server in the terminal. I would go and open the project in Xcode and hit the build button. It would lauch the simulator but I get the following error in the simulator: This operation couldn't be completed (TVMLKitErrorDomain error 3.) And in my console I would get this: CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Shared Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“SharedImageCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/SharedImageCache, NSUnderlyingError=0x6000004168e0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.238202-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: LSM Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“LSMImageCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/LSMImageCache, NSUnderlyingError=0x60000042c870 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.238767-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Trick Play Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“TrickPlay” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/TrickPlay, NSUnderlyingError=0x600000447450 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.239321-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Photo Stream Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“PhotostreamImages” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/PhotostreamImages, NSUnderlyingError=0x60000042ca20 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.264212-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: AR Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“ARFileCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/ARFileCache, NSUnderlyingError=0x60000042cc00 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.383110-0500 CreateTVMLApp[82816:2094742] screen parameters are unexpected: MGScreenClass1920x1080x1x40 SCREEN_TYPE(1920,1080,1, 40) 2021-02-01 09:01:42.415012-0500 CreateTVMLApp[82816:2095237] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed 2021-02-01 09:01:42.498897-0500 CreateTVMLApp[82816:2095248] [System] <IKAppContext (0): 0x60000337f100> Unable to start script (http://localhost:9001//application.js) because of SyntaxError: Unexpected token '<': {   line = 1;   sourceURL = "http://localhost:9001//application.js"; } 2021-02-01 09:01:42.499296-0500 CreateTVMLApp[82816:2094742] [System] App Context Failed with Error: Error Domain=ITMLKitErrorDomain Code=101 "(null)" UserInfo={line=1, sourceURL=http://localhost:9001//application.js} appController(_:didFail:) invoked with error: Error Domain=TVMLKitErrorDomain Code=3 "(null)" Apparently, it cannot find the application.js file, but not sure why and how to go about this
2
0
1.8k
Dec ’21
Can get player to repeat, mediaItemWillChange doesn't fire?
I'm new to tvML, so chances are I'm missing something easy... The script runs fine no errors, video plays, mediaItemWillChange event never fires to play the video again. Any suggestions would be greatly appreciated. App.onLaunch = function (options) { var video = new MediaItem('video', 'https://localhost/file_example_MP4_1920_18MG.mp4'); var player = new Player(); var playlist = new Playlist(); player.playlist = playlist; player.playlist.push(video); var parser = new DOMParser(); var alertString = '<?xml version="1.0" encoding="UTF-8" ?>' + '<document>' + '<alertTemplate>' + '</alertTemplate>' + '</document>'; var alertDoc = parser.parseFromString(alertString, "application/xml"); player.interactiveOverlayDocument = alertDoc; player.interactiveOverlayDismissable = false; player.addEventListener("mediaItemWillChange", function (e) { player.playlist.push(video); }); player.play(); }
0
0
715
Oct ’21
How to Display Multiple Fields in a User Registration Form Using TVML for Apple TV?
Hello, I am currently developing an application for Apple TV using TVML, and I am trying to create a user registration or login form with multiple input fields (e.g., "Username" and "Password"). However, I am facing issues with displaying multiple textField components in the formTemplate. Here are the approaches I have tried: Attempt 1: <document> <formTemplate> <banner> <title>Login</title> </banner> <banner> <textField>UserName</textField> </banner> <banner> <textField>Password</textField> </banner> <footer> <button id="button1"> <text>Button 1</text> </button> </footer> </formTemplate> </document> Attemp 2: <document> <formTemplate> <banner> <title>Login</title> </banner> <textField>UserName</textField> <textField>Password</textField> <footer> <button id="button1"> <text>Button 1</text> </button> </footer> </formTemplate> </document> In both cases, the layout does not render the fields as expected. Either the textField components do not display at all, or the structure seems incorrect. Could someone please guide me on the proper way to display multiple textField components in a formTemplate? Is there a limitation or specific requirement for structuring these elements? Thank you in advance for your assistance!
Replies
0
Boosts
0
Views
603
Activity
Jan ’25
TVML web inspector stopped working?
Did anyone experience that the Safari/Safari Web Preview web inspector stopped working for TVML projects? In the past it was possible to browse DOM elements using that tool - at this moment it's always empty. If you have any hints to make it working again I would be glad to hear it, thx! tools stack Safari 16.6 macOS 13.5 (22G74) Xcode version 15.0 (15A240d)
Replies
0
Boosts
0
Views
728
Activity
Oct ’23
Change the color of badge for a highlighted buttonLockup
When a button is highlighted, the icons change color automatically, is there any way to select which color they change to?
Replies
0
Boosts
0
Views
531
Activity
Sep ’23
TVML apps cause memory leaks
Hi all ! I have been working a while in this issue , first i started instrumenting our product trying to remove all dependency that can be causing retain memory until the app source only contains the AppDelegate and the TVApplicationController delegates implementation loading the TVML App and the Javascript context. After that i just realise that any TVOS app using TVMLKit retain memory without cause and that eventually will provoque a CRASH exception because the device it will run outs memory. I realise that by implementing a Hello World TVML App and doing MemoryLeaks instrument measurements and is imposible to know where is the source of this memory retentions when the app start. ** For the folks of Apple Developer Technical Support (DTS) : ** Case ID : 3279774 Apple Feedback link : https://feedbackassistant.apple.com/feedback/12540693 Anyone else seeing this issue? We have all our customers impacted by this problem
Replies
0
Boosts
0
Views
737
Activity
Aug ’23
TVML Player JS start playing delay content behind the current LIVE timestamp
Hi all ! I have been working a while on this problem . Turns out some of our customers when playing LIVE HLS content through a TVML Application using the standard Player JS API , for some channels the content start playing 5 mins before live timestamp witch is an unexpected behavior using this Player API. As a developer , i took the channels customer content and implement 2 Sample tvOS Apps : By using Fairplay + AVPlayerController , all native implementation and the issue is not reproducible . By using FairPlay + Player JS API , a TVML Sample implementation and the issue i always reproducible. **For the folks of Apple Developer Technical Support (DTS) : ** Case ID : 3280424 Apple Feedback link : https://feedbackassistant.apple.com/feedback/12565232 Anyone else seeing this issue?
Replies
0
Boosts
0
Views
756
Activity
Aug ’23
TVML Basic and Technical Questions from TVML Rookie
Hi Guys, I did lot of iOS, tvOS and macOS developemnt with UIKit and SwiftUI, but TVML appears to have really steep learning curve. When searching online and in this forum, posts are 7 years old and most often there are no replies. Is TVML something already obsolete and abandoned by Apple? Does it make sense to try quickly building streaming app using TVML? Is it better to start in SwiftUI and build templates from scratch and forget about TVML? What's nice that I can quickly build a page with collections of videos, however I struggle for several hours to do the simplest thing like adding a simple element with title, subtitle and play button. Why this doesn't display anything inside stackTemplate? <banner> <stack> <title>My Title</title> </stack> </banner> Why this doesn't display anything inside stackTemplate? <collectionList> <shelf id="row0"> <section binding="items:{videos}"> <prototypes> <lockup prototype="play" videoURL="https://storage.googleapis.com/media-session/sintel/trailer.mp4" > <title style="margin: 20; color: white; font-size: 60" binding="textContent:{title}"/> </lockup> </prototypes> </section> </shelf> If I add image to the loclkup element, it works and displays image and title. But if I want to add only title and subtitle and play button, it doesn't work. Is img manadatory inside lockup element? In documentation I cannot find, which subelement is mandatory and which is optional. Why cannot I add stack element as a prototype into the section element? Although I'm a native developer and don't really like HTML, I thought that TVML works in a similar way and I can add almost any element into any other element, like building HTML and TVML platform will stack up UI elements based on that. However it appears to be severely limited. Rules for even a basic element inside another layout element are so strict that I cannot tell ahead if it's going to work. Why doesn't it at least display elements that are defined correctly? Usually when one of the elements is invalid, then the whole section or shelf or container in general is hidden from view. It's impossible to build UI from the ground up. For example I thought I could add lockup element with title, see how it looks, than add subtitle and continue adding elements one by one. However if lockup with title simply doesn't display at all, I cannot figure out what's wrong, there is no error message in the console. Documentation is insufficient, it's not possible to figure out from that how each TVML UI elements works, what's mandatory and what's optional, sometimes I was actually add element inside another element even though docs didn't say it's possible. Like adding stack to some element, which I no longer rememeber. Is it possible to debug TVML somehow? Is it possible to debug JS in Xcode? Is there any TVML preview like in case of xib or SwiftUI? So far I always have to rebuild the app and look in the simulator screen. But often it caches the results and I have to delete the app from simulator, clean the build and rebuild again. It's very time consuming. Is there nay way to clear the cache (hot key)? Thanks.
Replies
0
Boosts
1
Views
1.1k
Activity
Jul ’23
Cannot play videos on tvOS 16.
What is causing the problem with the app and how should I approach the solution? I have taken over the development of a video viewing application that runs on tvOS. Recently, a user reported that he could not play videos on tvOS 16. I built the application in xcode and tried to play the video on tvOS 16.4 in simulator. Then a symbol similar to 🚫 appeared on the video player and the video could not be played. UIKit and TVML Kit JS are used in the source code. Video source is HLS with H.264 codec When playback failed, Xcode displayed the following error message. 023-05-26 12:59:58.477905+0900 hoge_tvOS[35421:14197398] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x6000007080a0 H:|-(95)-[UIStackView:0x155247910] (active, names: '|':UIView:0x155247770 )>", "<NSLayoutConstraint:0x6000007082d0 UIStackView:0x155247910.trailing == UIView:0x155247770.trailing - 95 (active)>", "<NSLayoutConstraint:0x6000007f38e0 H:|-(0)-[UIView:0x155247770] (active, names: '|':_AVFocusContainerView:0x151d431f0 )>", "<NSLayoutConstraint:0x6000007f3930 UIView:0x155247770.trailing == _AVFocusContainerView:0x151d431f0.trailing (active)>", "<NSLayoutConstraint:0x60000070b1b0 '_UITemporaryLayoutWidth' _AVFocusContainerView:0x151d431f0.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x6000007082d0 UIStackView:0x155247910.trailing == UIView:0x155247770.trailing - 95 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. I have confirmed in the past that it can be played on tvOS 14. Thanks for reading.
Replies
0
Boosts
3
Views
979
Activity
Jul ’23
How often does Apple gets data from universal search feed that I am proving for my app
How frequently does Apple retrieve data from my provided Universal Search feed API and how often do they refresh their data? I am inquiring about both VOD and live content. Regarding live content, is it only necessary to provide an availability feed, or should both an availability feed and content feed be provided for VOD?
Replies
0
Boosts
0
Views
1k
Activity
Apr ’23
tvOS Info Panel Metadata
Hi, I’m looking to see if it is possible to add a png image or any other rating icon to the content rating metadata as Apple TV has for the rotten tomatoes (🍅 66%) as an example in parentheses. I could not find an answer anywhere in Apple dev documents, I’m looking to add this to my application. Please clarify if it’s even possible.
Replies
0
Boosts
0
Views
890
Activity
Apr ’23
TVOS TVML XMLHttpRequest memory leak crashes application
I have a simple TVML app that displays shop-floor status data, the JS hits a webservice every 60 seconds and pulls an updated TVML string and loads it to the DOM. It works great for about 4 hours then crashes due to a memory leak caused by XMLHttpRequest not being deposed of properly. I've tried various ways to release the object, but nothing seems to have any affect. Any suggestions? Apple TV device log error is: 90 seconds cpu time over 90 seconds (100% cpu average), exceeding limit of 50% cpu over 180 seconds App.onLaunch = function (options) { var ip = options.IP; var refreshRate = options.REFRESH_RATE; //reload js every 15 minutes setTimeout(function () { App.reload() }, 900000); //refresh at passed in interval setInterval(function () { getTemplate(ip) }, refreshRate); loadingMessage(ip); getTemplate(ip); } function pushDoc(doc) { if (doc != null) { navigationDocument.clear(); navigationDocument.pushDocument(doc); } } function getTemplate(ip) { try { var url = "http://GetTemplate?ip=" + ip; var request = new XMLHttpRequest(); request.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { pushDoc(request.responseXML); delete request; request = null; } }; request.responseType = "document"; request.open("GET", url); request.send(); } catch (err) { errorMessage(ip, "getTemplate()", err.message) } } function loadingMessage(ip) { var loadingString = "<?xml version='1.0' encoding='UTF-8' ?>"; loadingString += "<document>"; loadingString += "<alertTemplate>"; loadingString += "<title>IP: " + ip + " - " + now() + "</title>"; loadingString += "<description>Loading...</description>"; loadingString += "</alertTemplate>"; loadingString += "</document>"; var loading = new DOMParser(); var doc = loading.parseFromString(loadingString, "application/xml"); pushDoc(doc); } function errorMessage(ip, func, err) { var errorString = "<?xml version='1.0' encoding='UTF-8' ?>"; errorString += "<document>"; errorString += "<alertTemplate>"; errorString += "<title>IP: " + ip + " - " + now() + "</title>"; errorString += "<description>" + func + " failed! Error is: " + err + "</description>"; errorString += "</alertTemplate>"; errorString += "</document>"; var error = new DOMParser(); var doc = error.parseFromString(errorString, "application/xml"); pushDoc(doc); } function now() { var currentdate = new Date(); var datetime = ((currentdate.getMonth() + 1) < 10 ? '0' : '') + (currentdate.getMonth() + 1) + "/" + (currentdate.getDate() < 10 ? '0' : '') + currentdate.getDate() + "/" + currentdate.getFullYear() + " @ " + (currentdate.getHours() < 10 ? '0' : '') + currentdate.getHours() + ":" + (currentdate.getMinutes() < 10 ? '0' : '') + currentdate.getMinutes() + ":" + (currentdate.getSeconds() < 10 ? '0' : '') + currentdate.getSeconds(); return datetime; }
Replies
0
Boosts
0
Views
1.2k
Activity
May ’22
Any recent updates on AppleTV supporting HTML/Webview?
Hi! I searched around but could not find any recent references on AppleTV planning to support HTML/Webview. Does anyone have any updates about this, if Apple is planning to add support to HTML/WKWebView in the near future? Thanks!
Replies
0
Boosts
0
Views
1k
Activity
May ’22
Trigger formTemplate Button from iPhone enter
I have a formTemplate and when the user starts typing, the keyboard opens on the iPhone for faster typing. How can I make the button in the formTemplate triggered by the iphone enter button? Is there any eventListener or similar? function emailTemplate() { var template = "<document><formTemplate><banner><description>Enter email for access</description></banner><textField id='email' keyboardType='emailAddress'>Your email</textField><footer><button><text>Submit</text></button></footer></formTemplate></document>"; // var parser = new DOMParser(); // var doc = parser.parseFromString(template , "application/xml"); var templateParser = new DOMParser(); var parsedTemplate = templateParser.parseFromString(template, "application/xml"); var loading = loadingTemplate(); loadingScreen); pushPage(parsedTemplate, loading); var email = parsedTemplate.getElementById("email"); parsedTemplate.addEventListener("select", function() { submit(email); }); } function submit(textField) { var keyboard = textField.getFeature('Keyboard'); var email = keyboard.text; if (isValidEmailAddress(email)) { localStorage.setItem("email", email); initPage(); } else { console.log("amail is not valid"); } }
Replies
1
Boosts
0
Views
825
Activity
Mar ’22
Exception from TVML Background Audio tvOs15 - AVPlayerPlaybackCoordinator
When we add a background audio element in tvOs v15 it generates the exception below: Exception            NSException *    "*** -[AVPlayerPlaybackCoordinator setFigPlaybackCoordinator:] invalid parameter not satisfying: figPlaybackCoordinator != NULL"  0x00006000010d16e0 Below is our TVML: <?xml version="1.0" encoding="UTF-8" ?> <document> <head> <style> * { <!-- To cutomize the interval image is displayed on screen --> tv-transition-interval:8.0; } </style> </head> <mainTemplate> <background> <img src="{{ our server }}/temp/AppleTvProto1/splash.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_1.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_2.jpg" /> <audio> <asset id="main_audio" src="{{ our server }}/temp/AppleTvProto1/background.mp3" /> </audio> </background> <menuBar> <section> <menuItem onselect="getDocument('/appletv-live')"> <title>Live</title> </menuItem> <menuItem onselect="getDocument('/appletv-messages')"> <title>Messages</title> </menuItem> <menuItem onselect="getDocument('/appletv-music')"> <title>Music</title> </menuItem> </section> </menuBar> </mainTemplate> </document>
Replies
4
Boosts
0
Views
1.5k
Activity
Feb ’22
pages crash
Hello, I have a problem with the text editor pages, if I have a object that I added with the "+" button that is on the right top of the screen. then if I try to write any texte that isn't in a object, the program will crash. I only have this bug since yesterday. tanks for reading my bug report
Replies
0
Boosts
0
Views
534
Activity
Jan ’22
Client-server TVML App Sample Code crashes
Hi there, I just downloaded the Sample Code provided by de developer documentation in order to run a simple Client-Server app with TVML Kit for tvOS. https://developer.apple.com/documentation/tvmljs/creating_a_client-server_tvml_app I'm following the docs step by step and after running the server in the terminal. I would go and open the project in Xcode and hit the build button. It would lauch the simulator but I get the following error in the simulator: This operation couldn't be completed (TVMLKitErrorDomain error 3.) And in my console I would get this: CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Shared Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“SharedImageCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/SharedImageCache, NSUnderlyingError=0x6000004168e0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.238202-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: LSM Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“LSMImageCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/LSMImageCache, NSUnderlyingError=0x60000042c870 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.238767-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Trick Play Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“TrickPlay” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/TrickPlay, NSUnderlyingError=0x600000447450 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.239321-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Photo Stream Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“PhotostreamImages” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/PhotostreamImages, NSUnderlyingError=0x60000042ca20 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.264212-0500 CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: AR Asset Group, Error Domain=NSCocoaErrorDomain Code=4 "“ARFileCache” couldn’t be removed." UserInfo={NSUserStringVariant=(   Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basic-tvml-app/ARFileCache, NSUnderlyingError=0x60000042cc00 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2021-02-01 09:01:42.383110-0500 CreateTVMLApp[82816:2094742] screen parameters are unexpected: MGScreenClass1920x1080x1x40 SCREEN_TYPE(1920,1080,1, 40) 2021-02-01 09:01:42.415012-0500 CreateTVMLApp[82816:2095237] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed 2021-02-01 09:01:42.498897-0500 CreateTVMLApp[82816:2095248] [System] <IKAppContext (0): 0x60000337f100> Unable to start script (http://localhost:9001//application.js) because of SyntaxError: Unexpected token '<': {   line = 1;   sourceURL = "http://localhost:9001//application.js"; } 2021-02-01 09:01:42.499296-0500 CreateTVMLApp[82816:2094742] [System] App Context Failed with Error: Error Domain=ITMLKitErrorDomain Code=101 "(null)" UserInfo={line=1, sourceURL=http://localhost:9001//application.js} appController(_:didFail:) invoked with error: Error Domain=TVMLKitErrorDomain Code=3 "(null)" Apparently, it cannot find the application.js file, but not sure why and how to go about this
Replies
2
Boosts
0
Views
1.8k
Activity
Dec ’21
Can get player to repeat, mediaItemWillChange doesn't fire?
I'm new to tvML, so chances are I'm missing something easy... The script runs fine no errors, video plays, mediaItemWillChange event never fires to play the video again. Any suggestions would be greatly appreciated. App.onLaunch = function (options) { var video = new MediaItem('video', 'https://localhost/file_example_MP4_1920_18MG.mp4'); var player = new Player(); var playlist = new Playlist(); player.playlist = playlist; player.playlist.push(video); var parser = new DOMParser(); var alertString = '<?xml version="1.0" encoding="UTF-8" ?>' + '<document>' + '<alertTemplate>' + '</alertTemplate>' + '</document>'; var alertDoc = parser.parseFromString(alertString, "application/xml"); player.interactiveOverlayDocument = alertDoc; player.interactiveOverlayDismissable = false; player.addEventListener("mediaItemWillChange", function (e) { player.playlist.push(video); }); player.play(); }
Replies
0
Boosts
0
Views
715
Activity
Oct ’21