diff --git a/stremio-core-protobuf/proto/stremio/core/models/player.proto b/stremio-core-protobuf/proto/stremio/core/models/player.proto index 4f98293..e9ac6d7 100644 --- a/stremio-core-protobuf/proto/stremio/core/models/player.proto +++ b/stremio-core-protobuf/proto/stremio/core/models/player.proto @@ -22,6 +22,7 @@ message Player { optional stremio.core.types.Video.SeriesInfo series_info = 6; optional stremio.core.types.LibraryItem library_item = 7; optional StreamState stream_state = 8; + optional IntroOutro intro_outro = 9; message VideoParams { optional string hash = 1; @@ -53,6 +54,15 @@ message Player { optional stremio.core.types.ResourceRequest meta_request = 3; optional stremio.core.types.ResourcePath subtitles_path = 4; } + message IntroOutro { + optional IntroData intro = 1; + optional uint64 outro = 2; + } + message IntroData { + required uint64 from = 1; + required uint64 to = 2; + optional uint64 duration = 3; + } } message LoadableSubtitles { diff --git a/stremio-core-protobuf/src/model/fields/player.rs b/stremio-core-protobuf/src/model/fields/player.rs index 74ee184..62ad94a 100644 --- a/stremio-core-protobuf/src/model/fields/player.rs +++ b/stremio-core-protobuf/src/model/fields/player.rs @@ -8,6 +8,7 @@ use stremio_core::{ runtime::Env, types::{ addon::ResourceRequest, + player::{IntroData, IntroOutro}, resource::Video, streams::{AudioTrack, StreamItemState, SubtitleTrack}, }, @@ -74,6 +75,25 @@ impl FromProtobuf for models::player::VideoParams { } } +impl ToProtobuf for IntroOutro { + fn to_protobuf(&self, _args: &()) -> models::player::IntroOutro { + models::player::IntroOutro { + intro: self.intro.to_protobuf::(&()), + outro: self.outro, + } + } +} + +impl ToProtobuf for IntroData { + fn to_protobuf(&self, _args: &()) -> models::player::IntroData { + models::player::IntroData { + from: self.from, + to: self.to, + duration: self.duration, + } + } +} + impl ToProtobuf for VideoParams { fn to_protobuf( &self, @@ -194,6 +214,7 @@ impl ToProtobuf for Player { series_info: self.series_info.to_protobuf::(&()), library_item: self.library_item.to_protobuf::(&(*ctx, None)), stream_state: self.stream_state.to_protobuf::(&()), + intro_outro: self.intro_outro.to_protobuf::(&()), } } }