Story Extension
24時間で消える一時的なコンテンツ(ストーリー)をActivityPubで配信するための拡張仕様。 Instagram StoriesやSnapchat Storiesのような機能を分散SNSで実現します。
概要
Story拡張は、時間制限付きのコンテンツを配信するためのActivityPub拡張です。
AS2標準の Note を拡張し、複数フレーム(画像/動画)の順序付きリストと
各フレームの表示時間を定義します。
設計方針
- AS2互換 - 標準プロパティ(endTime, duration等)を最大限活用
- 下位互換 - Story非対応の実装でも通常のNoteとして表示可能
- 拡張性 - 投票、質問などAS2標準型との組み合わせが可能
名前空間
Story拡張は以下の名前空間を使用します:
https://yurucommu.com/ns/story#
JSON-LD Context
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"story": "https://yurucommu.com/ns/story#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"Story": "story:Story",
"StoryFrame": "story:StoryFrame",
"frames": {
"@id": "story:frames",
"@container": "@list"
},
"displayDuration": {
"@id": "story:displayDuration",
"@type": "xsd:duration"
},
"replyPolicy": "story:replyPolicy",
"reactionPolicy": "story:reactionPolicy"
}
]
}
型定義
Story
ストーリーオブジェクト。AS2の Note を拡張します。
| プロパティ | 型 | 説明 |
|---|---|---|
type |
Array | ["Story", "Note"] |
frames |
Array<StoryFrame> | 順序付きフレームのリスト |
endTime |
DateTime | ストーリーの有効期限(AS2標準) |
replyPolicy |
String | 返信ポリシー(optional) |
reactionPolicy |
String | リアクションポリシー(optional) |
StoryFrame
ストーリーの1フレーム。画像、動画、または質問などを含むことができます。
| プロパティ | 型 | 説明 |
|---|---|---|
type |
String | "StoryFrame" |
displayDuration |
xsd:duration | 表示時間(例: PT5S = 5秒) |
attachment |
Array | メディア(Document, Video, Question等) |
content |
String | オーバーレイテキスト(optional) |
例
基本的なストーリー(単一画像)
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"story": "https://yurucommu.com/ns/story#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"Story": "story:Story",
"StoryFrame": "story:StoryFrame",
"frames": { "@id": "story:frames", "@container": "@list" },
"displayDuration": { "@id": "story:displayDuration", "@type": "xsd:duration" }
}
],
"id": "https://example.com/users/alice/stories/2026-01-14/1",
"type": ["Story", "Note"],
"attributedTo": "https://example.com/users/alice",
"published": "2026-01-14T10:00:00Z",
"startTime": "2026-01-14T10:00:00Z",
"endTime": "2026-01-15T10:00:00Z",
"to": ["https://example.com/users/alice/followers"],
"summary": "(任意)CW/注意書き",
"content": "おはよう",
"frames": [
{
"type": "StoryFrame",
"displayDuration": "PT5S",
"attachment": [
{
"type": "Document",
"mediaType": "image/jpeg",
"url": "https://example.com/media/story/abc123.jpg",
"name": "frame-1"
}
]
}
]
}
複数フレーム(画像 → 動画 → 質問)
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"story": "https://yurucommu.com/ns/story#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"Story": "story:Story",
"StoryFrame": "story:StoryFrame",
"frames": { "@id": "story:frames", "@container": "@list" },
"displayDuration": { "@id": "story:displayDuration", "@type": "xsd:duration" }
}
],
"id": "https://example.com/users/alice/stories/2026-01-14/2",
"type": ["Story", "Note"],
"attributedTo": "https://example.com/users/alice",
"published": "2026-01-14T12:00:00Z",
"endTime": "2026-01-15T12:00:00Z",
"to": ["https://example.com/users/alice/followers"],
"frames": [
{
"type": "StoryFrame",
"displayDuration": "PT5S",
"attachment": [
{
"type": "Document",
"mediaType": "image/png",
"url": "https://example.com/media/story/frame1.png"
}
],
"content": "画像の上に出すテキスト"
},
{
"type": "StoryFrame",
"displayDuration": "PT15S",
"attachment": [
{
"type": "Video",
"mediaType": "video/mp4",
"url": "https://example.com/media/story/frame2.mp4",
"duration": "PT12S"
}
]
},
{
"type": "StoryFrame",
"displayDuration": "PT7S",
"attachment": [
{
"type": "Question",
"name": "今日どっちがいい?",
"oneOf": [
{ "type": "Note", "name": "A" },
{ "type": "Note", "name": "B" }
],
"closed": "2026-01-14T20:00:00Z"
}
]
}
]
}
配信
StoryはActivityPubの Create アクティビティで配信されます。
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"actor": "https://example.com/users/alice",
"to": ["https://example.com/users/alice/followers"],
"object": {
"type": ["Story", "Note"],
"id": "https://example.com/users/alice/stories/2026-01-14/1",
...
}
}
削除
ストーリーの期限切れ時、または手動削除時は Delete アクティビティを送信します。
endTime を過ぎたストーリーは、受信側で自動的に非表示にすることが推奨されます。
実装上の注意
- 下位互換性 -
type: ["Story", "Note"]とすることで、Story非対応の実装でもNoteとして表示可能 - 期限管理 -
endTimeを必ず設定し、期限切れコンテンツは表示しない - displayDuration形式 - ISO 8601 duration形式(
PT5S= 5秒、PT1M30S= 1分30秒) - 動画の尺 - 動画の実際の長さはAS2標準の
durationプロパティを使用 - アスペクト比 - 推奨は縦型9:16(1080x1920px)。モバイルファーストで全画面表示に最適化
推奨メディアサイズ
| 形式 | 推奨サイズ | 最大尺 |
|---|---|---|
| 画像 | 1080x1920px (9:16) | - |
| 動画 | 1080x1920px (9:16) | 60秒 |
参考
関連仕様
- Story Canvas Editor 仕様 - ストーリー作成UIのレンダリング仕様(Yurucommuローカル)