1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.actions.sdk.v2.interactionmodel.prompt;
18
19import "google/actions/sdk/v2/interactionmodel/prompt/content/static_image_prompt.proto";
20import "google/protobuf/duration.proto";
21
22option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/interactionmodel/prompt;prompt";
23option java_multiple_files = true;
24option java_outer_classname = "StaticMediaPromptProto";
25option java_package = "com.google.actions.sdk.v2.interactionmodel.prompt";
26
27// Contains information about the media, such as name, description, url, etc.
28// Next id: 11
29message StaticMediaPrompt {
30  // Media type of this response.
31  enum MediaType {
32    // UNSPECIFIED value
33    MEDIA_TYPE_UNSPECIFIED = 0;
34
35    // Audio file.
36    AUDIO = 1;
37
38    // Response to acknowledge a media status report.
39    MEDIA_STATUS_ACK = 2;
40  }
41
42  // Media control types the media response can supported optionally
43  enum OptionalMediaControls {
44    // Unspecified value
45    OPTIONAL_MEDIA_CONTROLS_UNSPECIFIED = 0;
46
47    // Paused event. Triggered when user pauses the media.
48    PAUSED = 1;
49
50    // Stopped event. Triggered when user exit out 3p session during media play.
51    STOPPED = 2;
52  }
53
54  // The types of repeat mode for a list of media objects.
55  enum RepeatMode {
56    // Equivalent to OFF.
57    REPEAT_MODE_UNSPECIFIED = 0;
58
59    // End media session at the end of the last media object.
60    OFF = 1;
61
62    // Loop to the beginning of the first media object when the end of the last
63    // media object is reached.
64    ALL = 2;
65  }
66
67  // Media type of this response.
68  MediaType media_type = 8;
69
70  // Start offset of the first media object.
71  google.protobuf.Duration start_offset = 5;
72
73  // Optional media control types this media response session can support.
74  // If set, request will be made to 3p when a certain media event happens.
75  // If not set, 3p must still handle two default control type, FINISHED and
76  // FAILED.
77  repeated OptionalMediaControls optional_media_controls = 6;
78
79  // List of media objects.
80  repeated MediaObject media_objects = 7;
81
82  // Repeat mode for the list of Media Objects.
83  RepeatMode repeat_mode = 9;
84}
85
86// Represents a single media object.
87message MediaObject {
88  // Name of this media object.
89  string name = 1;
90
91  // Description of this media object.
92  string description = 2;
93
94  // The url pointing to the media content.
95  string url = 3;
96
97  // Image to show with the media card.
98  MediaImage image = 4;
99}
100
101// Image to be shown inside a MediaPrompt.
102message MediaImage {
103  // Only one type of MediaImage is allowed.
104  oneof image {
105    // A large image, such as the cover of the album, etc.
106    StaticImagePrompt large = 1;
107
108    // A small image icon displayed on the right from the title.
109    // It's resized to 36x36 dp.
110    StaticImagePrompt icon = 2;
111  }
112}
113