所有人!
我正在构建JSON,但我不确定如何构建JSON的这一部分。
'playlist': [
{
'file': 'bunny.mp4',
'title': 'Big Buck Bunny Trailer',
'provder': 'rtmp',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/bunny.jpg',
'duration': '33.03',
'description': 'An animated short from the Blender project'
},
{
'file': 'sintel.mp4',
'title': 'Sintel',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/sintel.jpg',
'provider': 'rtmp',
'duration': '888.06',
'description': 'An animated short from the Blender project'
},
{
'file': 'elephant.mp4a',
'title': 'Elephant´s Dream',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/elephant.jpg',
'provider': 'rtmp',
'duration': '653.79',
'description': 'An animated short from the Blender project'
}
]
我可以做播放列表部分,但我不确定这三个子部分。
完整的json如下所示
{
'flashplayer': 'player.swf',
'id': 'playerID',
'width': '650',
'height': '240',
'playlist.position': 'right',
'playlist.size': '250',
'playlist': [
{
'file': 'bunny.mp4',
'title': 'Big Buck Bunny Trailer',
'provder': 'rtmp',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/bunny.jpg',
'duration': '33.03',
'description': 'An animated short from the Blender project'
},
{
'file': 'sintel.mp4',
'title': 'Sintel',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/sintel.jpg',
'provider': 'rtmp',
'duration': '888.06',
'description': 'An animated short from the Blender project'
},
{
'file': 'elephant.mp4a',
'title': 'Elephant´s Dream',
'streamer': 'rtmp://rtmp.server.com/application',
'image': 'http://thumbnails.server.com/thumbs/elephant.jpg',
'provider': 'rtmp',
'duration': '653.79',
'description': 'An animated short from the Blender project'
}
]
}
除了播放列表中的项目之外,我可以做任何事情。我之前使用了一个字典对象,只是调用(JavaScriptSerializer) serializer.Serialize(ConfigurationDictionary)将其转换为我想要的JSON。
有没有办法在播放列表部分中得到我想要的结果?
发布于 2012-08-10 04:48:47
将'playlist‘属性设置为包含所列属性(文件、标题、流、图像、提供商、持续时间、描述)的歌曲或曲目对象的数组或列表
Public Class Track
Public Property file as String
Public Property title as String
(etc)
End Class
Public Class Playlist
Public Property flashplayer As String
(etc)
Public Property playlist As List(Of Track)
End Class
然后,您可以只使用JSON库或函数。
https://stackoverflow.com/questions/11891538
复制相似问题