From 07552d3fdf17ae1791823b14ab3ca18a5e2f974c Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Wed, 13 Apr 2016 08:31:05 +0530 Subject: [PATCH 1/2] autoplay in m.audio and m.recording event (required for vector-im/vector-web#1358) --- event-schemas/examples/m.recording | 7 +++++ event-schemas/examples/m.room.message#m.audio | 5 +-- event-schemas/schema/m.recording | 31 +++++++++++++++++++ event-schemas/schema/m.room.message#m.audio | 4 +++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 event-schemas/examples/m.recording create mode 100644 event-schemas/schema/m.recording diff --git a/event-schemas/examples/m.recording b/event-schemas/examples/m.recording new file mode 100644 index 00000000000..24abfc9665b --- /dev/null +++ b/event-schemas/examples/m.recording @@ -0,0 +1,7 @@ +{ + "type": "m.recording", + "room_id": "!z0mnsuiwhifuhwwfw:matrix.org", + "content": { + "user_ids": ["@alice:matrix.org", "@bob:example.com"] + } +} diff --git a/event-schemas/examples/m.room.message#m.audio b/event-schemas/examples/m.room.message#m.audio index 367eb954061..8dda5d8aab8 100644 --- a/event-schemas/examples/m.room.message#m.audio +++ b/event-schemas/examples/m.room.message#m.audio @@ -6,7 +6,8 @@ "info": { "duration": 2140786, "size": 1563685, - "mimetype": "audio/mpeg" + "mimetype": "audio/mpeg", + "autoplay": true }, "msgtype": "m.audio" }, @@ -15,4 +16,4 @@ "room_id": "!jEsUZKDJdhlrceRyVU:localhost", "type": "m.room.message", "sender": "@example:localhost" -} +} diff --git a/event-schemas/schema/m.recording b/event-schemas/schema/m.recording new file mode 100644 index 00000000000..da416cbfdd4 --- /dev/null +++ b/event-schemas/schema/m.recording @@ -0,0 +1,31 @@ +{ + "type": "object", + "title": "Recording Event", + "description": "Informs the client of the list of users currently recording (an audio message.)", + "allOf": [{ + "$ref": "core-event-schema/event.yaml" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of user IDs recording in this room, if any." + } + }, + "required": ["user_ids"] + }, + "type": { + "type": "string", + "enum": ["m.recording"] + }, + "room_id": { + "type": "string" + } + }, + "required": ["type", "room_id", "content"] +} diff --git a/event-schemas/schema/m.room.message#m.audio b/event-schemas/schema/m.room.message#m.audio index cd55426c3b7..3aaff84c8a1 100644 --- a/event-schemas/schema/m.room.message#m.audio +++ b/event-schemas/schema/m.room.message#m.audio @@ -37,6 +37,10 @@ "duration": { "type": "integer", "description": "The duration of the audio in milliseconds." + }, + "autoplay": { + "type": "boolean", + "description": "Hint that the audio should start playing automatically." } } } From 7660ffbc7ff76a3f4dbf7a677489c8819332ab5c Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Thu, 2 Jun 2016 16:20:09 +0530 Subject: [PATCH 2/2] Merge m.recording with m.typing --- event-schemas/examples/m.recording | 7 ------- event-schemas/examples/m.typing | 4 +++- event-schemas/schema/m.recording | 31 ------------------------------ event-schemas/schema/m.typing | 20 ++++++++++++++++--- 4 files changed, 20 insertions(+), 42 deletions(-) delete mode 100644 event-schemas/examples/m.recording delete mode 100644 event-schemas/schema/m.recording diff --git a/event-schemas/examples/m.recording b/event-schemas/examples/m.recording deleted file mode 100644 index 24abfc9665b..00000000000 --- a/event-schemas/examples/m.recording +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "m.recording", - "room_id": "!z0mnsuiwhifuhwwfw:matrix.org", - "content": { - "user_ids": ["@alice:matrix.org", "@bob:example.com"] - } -} diff --git a/event-schemas/examples/m.typing b/event-schemas/examples/m.typing index 1d2c517b912..884a4253cea 100644 --- a/event-schemas/examples/m.typing +++ b/event-schemas/examples/m.typing @@ -2,6 +2,8 @@ "type": "m.typing", "room_id": "!z0mnsuiwhifuhwwfw:matrix.org", "content": { - "user_ids": ["@alice:matrix.org", "@bob:example.com"] + "user_ids": ["@alice:matrix.org", "@bob:example.com"], + "typing": ["@bob:example.com"], + "recording": ["@alice:matrix.org"] } } diff --git a/event-schemas/schema/m.recording b/event-schemas/schema/m.recording deleted file mode 100644 index da416cbfdd4..00000000000 --- a/event-schemas/schema/m.recording +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "object", - "title": "Recording Event", - "description": "Informs the client of the list of users currently recording (an audio message.)", - "allOf": [{ - "$ref": "core-event-schema/event.yaml" - }], - "properties": { - "content": { - "type": "object", - "properties": { - "user_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The list of user IDs recording in this room, if any." - } - }, - "required": ["user_ids"] - }, - "type": { - "type": "string", - "enum": ["m.recording"] - }, - "room_id": { - "type": "string" - } - }, - "required": ["type", "room_id", "content"] -} diff --git a/event-schemas/schema/m.typing b/event-schemas/schema/m.typing index 705b3b6c7af..4594c2b2280 100644 --- a/event-schemas/schema/m.typing +++ b/event-schemas/schema/m.typing @@ -1,7 +1,7 @@ { "type": "object", - "title": "Typing Event", - "description": "Informs the client of the list of users currently typing.", + "title": "Activity Event", + "description": "Informs the client of the list of active users (typing, recording, etc)", "allOf": [{ "$ref": "core-event-schema/event.yaml" }], @@ -10,12 +10,26 @@ "type": "object", "properties": { "user_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of user IDs active in this room, if any." + }, + "typing": { "type": "array", "items": { "type": "string" }, "description": "The list of user IDs typing in this room, if any." - } + }, + "recording": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of user IDs recording an audio message in this room, if any." + }, }, "required": ["user_ids"] },