Coder Social home page Coder Social logo

volumeslider's People

Contributors

azure-pipelines[bot] avatar krumelur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

volumeslider's Issues

Cannot access a disposed object. Object name: 'VolumeSliderPlugin.Droid.VolumeSliderRenderer'. (Android)

Hi, I have got the following error "Cannot access a disposed object.Object name: 'VolumeSliderPlugin.Droid.VolumeSliderRenderer'."

Reproduce:
1.Access the page that have implemented VolumeSlider and tried to adjust the volume at this time it is working perfectly.
2.After that left the page and go back to adjust the volume now you will get an error.

Here is the full error stack :

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'VolumeSliderPlugin.Droid.VolumeSliderRenderer'.
at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Android.Views.View.get_Context () [0x0000a] in <3921e1c40bf740cab0f47696b3ad1282>:0
at VolumeSliderPlugin.Droid.VolumeSliderRenderer.HandleDeviceVolumeChanged (System.Object sender, VolumeSliderPlugin.Droid.VolumeChangedEventArgs e) [0x0003a] in :0
at VolumeSliderPlugin.Droid.CustomMediaRouterCallback.OnRouteVolumeChanged (Android.Media.MediaRouter router, Android.Media.MediaRouter+RouteInfo info) [0x0002c] in :0
at Android.Media.MediaRouter+SimpleCallback.n_OnRouteVolumeChanged_Landroid_media_MediaRouter_Landroid_media_MediaRouter_RouteInfo_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_router, System.IntPtr native_info) [0x00019] in <3921e1c40bf740cab0f47696b3ad1282>:0
at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.75(intptr,intptr,intptr,intptr)

How to solve this issue?

Thank you in advance.

Cannot change volume via code.

I cannot seem to find a way to change the volume via code. Whatever volume I set in the code only takes effect when a user interacts with the volume slider.

<StackLayout>
    <!-- Place new controls here -->
    <Button Text="Siren!" 
       HorizontalOptions="Center"
       VerticalOptions="CenterAndExpand"
       Clicked="SirenBtnClicked">
    </Button>
    <vs:VolumeSlider x:Name="volumeSlider" Volume="0.5" WidthRequest="300" HorizontalOptions="Center"/>
</StackLayout>

private void SirenBtnClicked(object sender, EventArgs e)
{

        if (!audioPlayer.IsPlaying) {

            audioPlayer.Play();
            volumeSlider.SetValue(VolumeSlider.VolumeProperty, 1);
        }
        else
        {
            audioPlayer.Stop();
        }
        
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.