media.proto 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. syntax = "proto3";
  15. package google.actions.sdk.v2.conversation;
  16. import "google/actions/sdk/v2/conversation/prompt/content/image.proto";
  17. import "google/protobuf/duration.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/conversation;conversation";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "MediaProto";
  21. option java_package = "com.google.actions.sdk.v2.conversation";
  22. // Represents one media object.
  23. // Contains information about the media, such as name, description, url, etc.
  24. message Media {
  25. // Media type of this response.
  26. enum MediaType {
  27. // Unspecified media type.
  28. MEDIA_TYPE_UNSPECIFIED = 0;
  29. // Audio file.
  30. AUDIO = 1;
  31. // Response to acknowledge a media status report.
  32. MEDIA_STATUS_ACK = 2;
  33. }
  34. // Optional media control types the media response can support
  35. enum OptionalMediaControls {
  36. // Unspecified value
  37. OPTIONAL_MEDIA_CONTROLS_UNSPECIFIED = 0;
  38. // Paused event. Triggered when user pauses the media.
  39. PAUSED = 1;
  40. // Stopped event. Triggered when user exits out of 3p session during media
  41. // play.
  42. STOPPED = 2;
  43. }
  44. // Media type.
  45. MediaType media_type = 8;
  46. // Start offset of the first media object.
  47. google.protobuf.Duration start_offset = 5;
  48. // Optional media control types this media response session can support.
  49. // If set, request will be made to 3p when a certain media event happens.
  50. // If not set, 3p must still handle two default control type, FINISHED and
  51. // FAILED.
  52. repeated OptionalMediaControls optional_media_controls = 6;
  53. // List of Media Objects
  54. repeated MediaObject media_objects = 7;
  55. }
  56. // Represents a single media object
  57. message MediaObject {
  58. // Name of this media object.
  59. string name = 1;
  60. // Description of this media object.
  61. string description = 2;
  62. // The url pointing to the media content.
  63. string url = 3;
  64. // Image to show with the media card.
  65. MediaImage image = 4;
  66. }
  67. // Image to show with the media card.
  68. message MediaImage {
  69. // Image.
  70. oneof image {
  71. // A large image, such as the cover of the album, etc.
  72. Image large = 1;
  73. // A small image icon displayed on the right from the title.
  74. // It's resized to 36x36 dp.
  75. Image icon = 2;
  76. }
  77. }