MrJai / flutter_to_airplay

Flutter plugin that offers two widgets, one to play a video for a given URL or file path using native AVPlayer and second with an option to airplay it on available Apple devices.
MIT License
30 stars 24 forks source link

AirPlayRoutePickerView Scroll issue IOS #15

Closed EArminjon closed 3 years ago

EArminjon commented 3 years ago

Hi,

AirPlayRoutePickerView make serious scroll issue on flutter 2.2.2. Is it possible to create a method which we can call AirPlay to make the same result without the actual design (Uikit) ?

It's actually a blocking point for deploy a new release for my apps :)

MrJai commented 3 years ago

@EArminjon can you share some video, or steps to reproduce the issue?

EArminjon commented 3 years ago

Hum, I found that it is maybe a flutter related issue. When displaying your widget (UiKitView) with many ColorFiltered widget performance are bad.

You can close it.

Is it possible to create a callback instead of a widget to call airplay ?

MrJai commented 3 years ago

@EArminjon can you please confirm what values would you like to receive in the callback?

EArminjon commented 3 years ago

Hi @MrJai,

I didn't know well Apple but if possible just an empty method to call airplay. A simple method which will open the airplay pop up.

MrJai commented 3 years ago

So let's say we have this functionality, then what are you trying to do with this callback, are you trying to add it to onTap of some GestureDetector or onPressed of some button? I am just trying to understand the use case.

EArminjon commented 3 years ago

@MrJai Yep, exactly. I will call it through a gesture detector or something like that.

Like on image, on a text or on an other icon. I will care about apple requirement about this feature.

MrJai commented 3 years ago

@EArminjon Please check the example project, I added a new example for you to see how you can add custom icons, buttons, labels, or anything over the Airplay and make it work. I hope this will help your use case.

I will close this issue, once you confirm.

Simulator Screen Shot - iPhone 12 Pro Max - 2021-08-05 at 18 26 14 Simulator Screen Shot - iPhone 12 Pro Max - 2021-08-05 at 18 26 21

EArminjon commented 3 years ago

@MrJai Ty for your reply,

If I well understand, the tricks is to set transparent color to your main widget and put a custom one above ?

 Container(
  width: 44.0,
  height: 44.0,
  child: Stack(
    children: [
      IconButton(
        onPressed: null,
        icon: Icon(Icons.play_arrow),
      ),
      AirPlayRoutePickerView(
        tintColor: Colors.transparent,
        activeTintColor: Colors.transparent,
        backgroundColor: Colors.transparent,
      ),
    ],
  ),
),

No way to create a callback like that ?


myButton(
  onTap: () {
      FlutterAirPlay.open();
    };
  child: Icon(Icons.audio),
),
MrJai commented 3 years ago

Yes, you are right, you will have to add something over this widget.

I have not found a way to add some call back via method channel, it is only allowing me to add some widget/UIKitView. I will keep looking for this possibility and will surely update here once it is possible.