Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rfm1963
Binge Watcher

shortFormVideos JSON has 2 videos but only displays 1 on ROKU channel

shortFormVideos JSON has 2 videos but only displays 1 on ROKU channel. JSON code is below.

{
"providerName": "XXXXXX",
"language": "en-us",
"lastUpdated": "2020-01-28T18:12:32.125Z",
"shortFormVideos":
[{
"id": "100001",
"title": "Video 1",
"shortDescription": "2 Video Test 1 Max 200 characters",
"longDescription": "Test Long description (<500 characters) of my video",
"thumbnail": "https://amazonaws.com/image1.jpg",
"genres": ["comedy"],
"tags": ["comedy"],
"releaseDate": "2020-01-28",
"content":
{
"dateAdded": "2020-01-28",
"captions": [],
"duration": 600,
"videos":
[{
"url": "https://amazonaws.com/movie.mp4",
"quality": "HD",
"videoType": "MP4",
"bitrate": 1000
}]
},
"id": "100002",
"title": "Video 2",
"shortDescription": "2 Video Test 2 Max 200 characters",
"longDescription": "Test Long description (<500 characters) of my video",
"thumbnail": "https://amazonaws.com/image1.jpg",
"genres": ["comedy"],
"tags": ["comedy"],
"releaseDate": "2020-01-28",
"content":
{
"dateAdded": "2020-01-29",
"captions": [],
"duration": 240,
"videos":
[{
"url": "https://amazonaws.com/LQ.mp4",
"quality": "HD",
"videoType": "MP4",
"bitrate": 1000
}]
}


}]
}

0 Kudos
3 REPLIES 3
boogernose
Roku Guru

Re: shortFormVideos JSON has 2 videos but only displays 1 on ROKU channel

Nobody on this forum is gonna debug code.

This needs to be in Developers

https://community.roku.com/t5/Developers/ct-p/channel-developers

https://developer.roku.com/docs/specs/direct-publisher-feed-specs/json-dp-spec.md

---A problem clearly stated is a problem half solved---.
0 Kudos
37mediagroup
Roku Guru

Re: shortFormVideos JSON has 2 videos but only displays 1 on ROKU channel

Your code is really bad. Please ensure it passes https://jsonlint.com prior to asking others for assistance. You closed out Short Form Videos with the ending bracket ] after bitrate of video 1 which is why only 1 video likely showed. It also didn't have an opening bracket for ID; 0002, also likely had too many closing brackets at the end too but the thing was a mess. I fixed it below.

 

 

{
	"providerName": "XXXXXX",
	"language": "en-us",
	"lastUpdated": "2020-01-28T18:12:32.125Z",
	"shortFormVideos": [{
			"id": "100001",
			"title": "Video 1",
			"shortDescription": "2 Video Test 1 Max 200 characters",
			"longDescription": "Test Long description (<500 characters) of my video",
			"thumbnail": "https://amazonaws.com/image1.jpg",
			"genres": ["comedy"],
			"tags": ["comedy"],
			"releaseDate": "2020-01-28",
			"content": {
				"dateAdded": "2020-01-28",
				"captions": [],
				"duration": 600,
				"videos":

					[{
						"url": "https://amazonaws.com/movie.mp4",
						"quality": "HD",
						"videoType": "MP4",
						"bitrate": 1000
					}]
			}
		},
		{
			"id": "100002",
			"title": "Video 2",
			"shortDescription": "2 Video Test 2 Max 200 characters",
			"longDescription": "Test Long description (<500 characters) of my video",
			"thumbnail": "https://amazonaws.com/image1.jpg",
			"genres": ["comedy"],
			"tags": ["comedy"],
			"releaseDate": "2020-01-28",
			"content": {
				"dateAdded": "2020-01-29",
				"captions": [],
				"duration": 240,
				"videos": [{
					"url": "https://amazonaws.com/LQ.mp4",
					"quality": "HD",
					"videoType": "MP4",
					"bitrate": 1000
				}]
			}
		}
	]

}

 

rfm1963
Binge Watcher

Re: shortFormVideos JSON has 2 videos but only displays 1 on ROKU channel

Thanks for checking. I'm new to JSON scripting. I have updated my script and ingested it successfully. I'll post back here when I see my results.