【发布时间】:2016-01-09 09:11:57
【问题描述】:
我正在尝试制作 Apple tv 应用。
我正在使用来自 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} 但它不起作用。
【问题讨论】:
-
显示您正在使用的完整模板结构,您只有一个
listItemLockup。 -
已添加完整代码!谢谢
标签: javascript properties tvos apple-tv tvml