Googleの例があることに注意してください機能性を説明する。 私はランダムが入ってくる場所だと思っています。彼らは例のためのデータを生成しています。
私はdataprovider.jsをより理解しやすくするように変更しました。うまくいかなかったこと残念ながら
var gtv = gtv || {
jq: {}
};
/**
* DataProvider class. Defines a provider for all data (Categories, Images & Videos) shown in the template.
*/
gtv.jq.DataProvider = function() {
};
/**
* Returns all data shown in the template..
* @return {object} with the following structure:
* - categories -> [category1, category2, ..., categoryN].
* - category -> {name, videos}.
* - videos -> {thumb, title, subtitle, description, sources}
* - sources -> [source1, source2, ..., sourceN]
* - source -> string with the url | {src, type, codecs}
*/
gtv.jq.DataProvider.prototype.getData = function() {
var event_videos = [
{
sources: ['http://commondatastorage.googleapis.com/gtv_template_assets/IO2010-Keynote-day1.mp4'],
title: '2010 Day 1 Keynote',
thumb: 'images/thumbs/thumb01.jpg',
description: ['With Vic Gundotra'],
subtitle: 'Moscone Center'
},
{
sources:['http://commondatastorage.googleapis.com/gtv_template_assets/IO2010-Keynote-day2-android.mp4'],
title: '2010 Day 2 Keynote',
thumb: 'images/thumbs/thumb02.jpg',
description: ['Spider - what spider?'],
subtitle: 'Moscone Center'
}
];
var buck_videos = [
{
sources:['http://bffmedia.com/trailer_400p.ogg'],
title: 'Big Buck 400p Video Trailer',
thumb: 'http://www.bffmedia.com/buck1.png',
description: ['Common Creative Project Movie'],
subtitle: 'Smaller Version'
},
{
sources:['http://bffmedia.com/trailer_1080p.ogg'],
title: 'Big Buck 1080p Video Trailer',
thumb: 'http://www.bffmedia.com/buck2.png',
description:['Common Creative Project Movie'],
subtitle: 'Big Buck is a Rabbit'
}
];
var data = {
categories: [
{
name: 'Dev Events',
videos: event_videos
},
{
name: 'Big Buck',
videos: buck_videos
}
]
};
return data;
};
:ここ
が変更されたバージョンは、次のようになります。すべてのサムネイルと動画の読み込みが終了しました – ace973
今修正されていない場合は、誰かにライブラリのコードを修正するよう依頼します。 –
ありがとうLesは働いた。他の人へのジャスタの速報:あなたが異なる数のビデオを持っている場合は、ライン167を調整する必要があります。私は11のビデオを持っているので(var j = 0; j <11; j ++) – ace973