2016-11-28 62 views
2

我正在使用可用於tvOS的catalogTemplate。在relatedContent區域(由網格填充)中,我需要鎖定始終顯示視頻標題。目前,只有在項目突出顯示時纔會顯示。有沒有什麼辦法解決這一問題?tvOS:<grid>鎖定標題始終可見(不僅僅是突出顯示)

這是我的TVML。 (從後端的數據由Mustache.js渲染)

<?xml version="1.0" encoding="UTF-8" ?> 
<document> 
    <catalogTemplate theme="dark"> 
    <banner> 
     <title style="color: rgb(255, 255, 255); tv-align: left; font-size: 40; padding: 50; font-weight: bold;">Categories</title> 
    </banner> 
    <list> 
     {{#data.categories}} 
     <section> 
     <listItemLockup> 
      <title style="font-size: 30;">{{category}}</title> 
      <relatedContent> 
      <grid> 
       <header> 
       <title style="font-weight: bold;">{{category}}</title> 
       </header> 
       <section> 
       {{#videos}} 
       <lockup videoURL="{{video_url}}"> 
        <img src="{{thumbnail_url}}" width="300" height="169" /> 
        <title>{{title}}</title> 
       </lockup> 
       {{/videos}} 
       </section> 
      </grid> 
      </relatedContent> 
     </listItemLockup> 
     </section> 
     {{/data.categories}} 
    </list> 
    </catalogTemplate> 
</document> 

回答

0

雖然不是理想的,我能夠通過使用的,而不是以顯示視頻標題做到這一點。

+0

看起來你冷落的重要組成部分,這個答案,答案。使用_____而不是_____來顯示視頻標題。你能在這裏填空嗎? – Joopkins

0

我和你有同樣的問題。我通過替換videourlonselect來解決它。下面是例如:

<lockup onselect="playMedia('path to video', 'video')"> 
      <img src="path to image" width="182" height="274"/> 
      <title>Movie 1</title> 
    </lockup> 

找到它here

playMedia()是在功能的.js文件它的代碼如下所示。

function playMedia(extension, mediaType) { 
    var videourl = baseURL + extension; 
    var singleVideo = new MediaItem(mediaType, videourl); 
    var videoList = new Playlist(); 
    videoList.push(singleVideo); 
    var myPlayer = new Player(); 
    myPlayer.playlist = videoList; 
    myPlayer.play(); 
} 
1

我想設置tv-text-highlight-style風格將幫助您解決問題:

<title style="tv-text-highlight-style: marquee-on-highlight">{{title}}</title> 

其他選項和樣式可以發現here

相關問題