Skip to content

Commit

Permalink
Some changes and additions to the post structure
Browse files Browse the repository at this point in the history
  • Loading branch information
redsolver committed Feb 10, 2021
1 parent 8123780 commit 0f34d12
Showing 1 changed file with 105 additions and 68 deletions.
173 changes: 105 additions & 68 deletions feed-page/post/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,82 +10,116 @@
"parentHash":"sha256:24126b48452ce0243ae0f6bd3a3e0f9ee06ac01d5dab557c365b3e1bb8972fa5", // sha256sum of the JSON string of the post being reposted or commented on to prevent edits

"content": { // Every field in this map is OPTIONAL, if not specified otherwise
"mediaDuration": 1235312612, // duration of video or audio in milliseconds (int)

// video, audio and image follow the same format
// more specific formats should be listed FIRST
// if vcodec is specified, the file contains video (otherwise null)
// if acodec is specified, the file contains audio (otherwise null)
"video:": [ // video content with different resolution and file formats
{
"ext": "mp4",
"vcodec": "avc1.4d400b",
"fps": 25, // optional
"w": 1920, // width
"h": 1080, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA"
},
{
"ext": "webm",
"vcodec": "vp9",
"acodec": "mp4a.40.2",
"abr": 96, // kbps of the audio
"fps": 25, // optional
"w": 1920, // width
"h": 1080, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA/1920x1080_version.webm"
},
{
"ext": "webm",
"vcodec": "vp9",
"acodec": "mp4a.40.2",
"abr": 96, // kbps of the audio
"fps": 25, // optional
"w": 1280, // width
"h": 720, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA/1280x720_version.webm"
}
],
"audio": [ // audio content with different resolution and file formats
{
"ext": "mp3",
"acodec": "mp3",
"url": "sia://_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA"
},
{
"ext": "mp3",
"acodec": "mp3",
"abr": 192, // kbps of the audio
"url": "sia://_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA"
}
],
"image": [ // image content with different resolution and file formats
// also used as thumbnail when video is present
{
"ext": "png",
"w": 1920, // width
"h": 1080, // height
"url": "sia://sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
},
{
"ext": "png",
"w": 1280, // width
"h": 720, // height
"url": "sia://sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
},
"media": { // A media object can contain an image, video, audio or combination of all of them
"mediaDuration": 1235312612, // duration of video or audio in milliseconds (int)

// video, audio and image follow the same format
// more specific formats should be listed FIRST
// if vcodec is specified, the file contains video (otherwise null)
// if acodec is specified, the file contains audio (otherwise null)
"video:": [ // video content with different resolution and file formats
{
"ext": "mp4",
"vcodec": "avc1.4d400b",
"fps": 25, // optional
"w": 1920, // width
"h": 1080, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA"
},
{
"ext": "webm",
"vcodec": "vp9",
"acodec": "mp4a.40.2",
"abr": 96, // kbps of the audio
"fps": 25, // optional
"w": 1920, // width
"h": 1080, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA/1920x1080_version.webm"
},
{
"ext": "webm",
"vcodec": "vp9",
"acodec": "mp4a.40.2",
"abr": 96, // kbps of the audio
"fps": 25, // optional
"w": 1280, // width
"h": 720, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA/1280x720_version.webm"
}
],
"audio": [ // audio content with different resolution and file formats
{
"ext": "mp3",
"acodec": "mp3",
"url": "sia://_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA"
},
{
"ext": "mp3",
"acodec": "mp3",
"abr": 192, // kbps of the audio
"url": "sia://_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA"
}
],
"image": [ // image content with different resolution and file formats
// also used as thumbnail when video is present
{
"ext": "png",
"w": 1920, // width
"h": 1080, // height
"url": "sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
},
{
"ext": "png",
"w": 1280, // width
"h": 720, // height
"url": "sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
},
{
"ext": "jpeg",
"url": "sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
}
],
"aspectRatio": 1.457858769931663, // Aspect ratio of the image and the video
"blurHash": "L@L4$+00j@xuayjtfQayofayfQj[" // BlurHash of the image shown while loading
},
"gallery": [ // List of media objects in a "gallery", uses a list of the media structure
// can be show in a carousel or list
// useful for app screenshots or galleries
// NOT TO BE USED for something like music albums, because it prevents individual tracks from being referenced, saved, rated, reposted, ...
{
"ext": "jpeg",
"url": "sia://sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
"mediaDuration": 1235312612,
"video:": [
{
"ext": "mp4",
"vcodec": "avc1.4d400b",
"fps": 25, // optional
"w": 1920, // width
"h": 1080, // height
"url": "sia://CACqf4NlIMlA0CCCieYGjpViPGyfyJ4v1x3bmuCKZX8FKA"
}
],
"image": [
{
"ext": "jpeg",
"url": "sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
}
],
"aspectRatio": 1.457858769931663, // Aspect ratio of the image and the video
"blurHash": "L@L4$+00j@xuayjtfQayofayfQj[" // BlurHash of the image shown while loading
}

],
"link": "sia://skyfeed.hns", // Can be used as a link to a url referred by this post
"linkTitle": "SkyFeed - Decentralized social network", // title of the url, only used for preview

"title": "This is a title", // optional, higlighted and used as title of the post when available
"text": "Lorem ipsum dolor sit amet.", // REQUIRED Text content and/or description
"textContentType":"text/plain", // text/plain by default
"aspectRatio": 1.457858769931663, // Aspect ratio of the image and the video
"blurHash": "L@L4$+00j@xuayjtfQayofayfQj[", // BlurHash of the image shown while loading
"textContentType":"text/plain", // text/plain by default, also allows "text/html" and "text/markdown"
"tags":[ // Contains tags that have a special meaning used by the skapp to display it in a specific way or filter it out
"spoiler", // Used for spoilers
"nsfw" // Used for NSFW content
"nsfw", // Used for NSFW content
"skapp" // Used for skapps
],
"topics":[ // Can contain different topics (hashtags) this post fits into.
"siatech",
Expand All @@ -103,6 +137,9 @@
"app": { // Metadata about the app used to create this post
"name": "SkyFeed",
"location": "sia://skyfeed.hns"
},
"skapp": { // extension data for skapps (just referenced as an example, not part of the spec)
"logo":"sia://IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ"
}
},
"ts": 1606169889148, // Upload/posting date (Using a unix timestamp because it's compact and prevents timezone-specific bugs)
Expand Down

0 comments on commit 0f34d12

Please sign in to comment.