Play video in background (like spotify) using xamarin forms and android renderer

illomiillomi USMember ✭✭
edited May 2015 in Xamarin.Android

Hi,

I'm trying to play a video in the background of a contentpage .
In IOS it works using Xamarin Forms and renderer , but I can't make it work on Android .
Does anyone know how to do ?

Thanks
Matteo

Best Answer

Answers

  • CheesebaronCheesebaron DKInsider, University mod

    You need to create a Service on Android in order to be able to play sound in the background.

  • JulienGJulienG USMember

    Hello guys,
    I'm trying to achieve the same goal;

    Matteo, did you find something for Android ?

    And CheeseBaron, what do you mean by "play sound" ? In my case I just want to play a video (with no sound...)
    Thanks !

  • illomiillomi USMember ✭✭

    No, i don't find any solution for this.
    If i find it, i'll tell you.

    Matteo

  • illomiillomi USMember ✭✭

    Hi @JulienGoenaga ,
    I find a solution to avoid the problem,instead to use a video and play it in background, i usa a web view in background and add a .gif in this web view.
    Result is similar and it's the only solution i have find.
    i hope it help.

    Matteo.

  • @JulienG

    I have some questions about your post, I'm trying to make your code work, but I'm getting some errors, could you please explain me this lines:

        _videoView = new VideoView(Context);
    

    is there any other class defining this constructor? or where should I define this?

    also this line:

        Control.Holder.AddCallback(this);
    

    I cannot get the Holder option for the Control object.

    Is there any thing I'm missing?

  • AdamFisherAdamFisher USMember ✭✭

    You can check out a component I created here: https://components.xamarin.com/view/video-player

Sign In or Register to comment.