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

TVML Documentation

Posts under TVML tag

7 Posts
Sort by:
Post not yet marked as solved
2 Replies
949 Views
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
Posted
by
Post not yet marked as solved
4 Replies
800 Views
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>
Posted
by
Post not yet marked as solved
0 Replies
356 Views
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(); }
Posted
by
Post not yet marked as solved
0 Replies
190 Views
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
Posted
by
Post not yet marked as solved
1 Replies
172 Views
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"); } }
Posted
by
Post not yet marked as solved
0 Replies
120 Views
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; }
Posted
by