我正在尝试制作一个苹果电视应用程序。
我正在使用来自 tvOS 开发人员库的示例代码:
https://developer.apple.com/library/tvos/samplecode/TVMLAudioVideo/Introduction/Intro.html
我想从 application.js 显示这些数据:
video.title = metadata.title;
video.subtitle = metadata.subtitle;
video.description = metadata.description;
video.artworkImageURL = metadata.artworkImageURL;
var Videos = {
video: [{
title: "AV BipBop",
subtitle: "Sample HLS Stream",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
artworkImageURL: "",
contentRatingDomain: "movie",
contentRatingRanking: 400,
url: "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8"
}],
在我的 index.xml.js
/*
Copyright (C) 2015 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
A list template shows a list of items on the right, such as movies or TV shows. Focus on one to see its related content on the left, such as its artwork or description.
*/
var Template = function() {
return '<?xml version="1.0" encoding="UTF-8"?>' +
'<document>' +
'<listTemplate>' +
'<list>' +
'<header>' +
'<title>Playback examples</title>' +
'</header>' +
'<section>' +
'<listItemLockup id="video">' +
'<title> (Here video title ) </title>' +
'</listItemLockup>' +
'<listItemLockup id="playlist">' +
'<title>Playlist</title>' +
'</listItemLockup>' +
'</section>' +
'</list>' +
'</listTemplate>' +
'</document>';
}
我试过: ${title} 和 ${video.title} 但它不起作用。