Skip to content

Commit 80dd733

Browse files
Chris YangEgor
Chris Yang
authored and
Egor
committed
Revert "Revert "[video_player] Set audio mix options (flutter#2922)" (flutter#2938)" (flutter#2939)
This reverts commit d4750ea.
1 parent 69bede4 commit 80dd733

File tree

1 file changed

+50
-0
lines changed
  • packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer

1 file changed

+50
-0
lines changed

packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,31 @@ static MixWithOthersMessage fromMap(HashMap map) {
320320
}
321321
}
322322

323+
/** Generated class from Pigeon that represents data sent in messages. */
324+
public static class MixWithOthersMessage {
325+
private Boolean mixWithOthers;
326+
327+
public Boolean getMixWithOthers() {
328+
return mixWithOthers;
329+
}
330+
331+
public void setMixWithOthers(Boolean setterArg) {
332+
this.mixWithOthers = setterArg;
333+
}
334+
335+
HashMap toMap() {
336+
HashMap<String, Object> toMapResult = new HashMap<String, Object>();
337+
toMapResult.put("mixWithOthers", mixWithOthers);
338+
return toMapResult;
339+
}
340+
341+
static MixWithOthersMessage fromMap(HashMap map) {
342+
MixWithOthersMessage fromMapResult = new MixWithOthersMessage();
343+
fromMapResult.mixWithOthers = (Boolean) map.get("mixWithOthers");
344+
return fromMapResult;
345+
}
346+
}
347+
323348
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
324349
public interface VideoPlayerApi {
325350
void initialize();
@@ -608,6 +633,31 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
608633
channel.setMessageHandler(null);
609634
}
610635
}
636+
{
637+
BasicMessageChannel<Object> channel =
638+
new BasicMessageChannel<Object>(
639+
binaryMessenger,
640+
"dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers",
641+
new StandardMessageCodec());
642+
if (api != null) {
643+
channel.setMessageHandler(
644+
new BasicMessageChannel.MessageHandler<Object>() {
645+
public void onMessage(Object message, BasicMessageChannel.Reply<Object> reply) {
646+
MixWithOthersMessage input = MixWithOthersMessage.fromMap((HashMap) message);
647+
HashMap<String, HashMap> wrapped = new HashMap<String, HashMap>();
648+
try {
649+
api.setMixWithOthers(input);
650+
wrapped.put("result", null);
651+
} catch (Exception exception) {
652+
wrapped.put("error", wrapError(exception));
653+
}
654+
reply.reply(wrapped);
655+
}
656+
});
657+
} else {
658+
channel.setMessageHandler(null);
659+
}
660+
}
611661
}
612662
}
613663

0 commit comments

Comments
 (0)