cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Kravchuk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11856) Can't change volume on iOS while playing through avPlayer
Date Thu, 15 Sep 2016 11:23:20 GMT

    [ https://issues.apache.org/jira/browse/CB-11856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15493047#comment-15493047
] 

Igor Kravchuk commented on CB-11856:
------------------------------------

{code:swift}
- (void)setVolume:(CDVInvokedUrlCommand*)command
{
    NSString* callbackId = command.callbackId;

#pragma unused(callbackId)
    NSString* mediaId = [command argumentAtIndex:0];
    NSNumber* volume = [command argumentAtIndex:1 withDefault:[NSNumber numberWithFloat:1.0]];

    if ([self soundCache] != nil) {
        CDVAudioFile* audioFile = [[self soundCache] objectForKey:mediaId];
        if (audioFile != nil) {
            audioFile.volume = volume;
            if (audioFile.player) {
                audioFile.player.volume = [volume floatValue];
            }
			if (avPlayer.currentItem && avPlayer.currentItem.asset) {
				float customVolume = [volume floatValue];
				[avPlayer setVolume:customVolume];
            }
            [[self soundCache] setObject:audioFile forKey:mediaId];
        }
    }

    // don't care for any callbacks
}
{code}

> Can't change volume on iOS while playing through avPlayer
> ---------------------------------------------------------
>
>                 Key: CB-11856
>                 URL: https://issues.apache.org/jira/browse/CB-11856
>             Project: Apache Cordova
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Plugin Media
>            Reporter: Igor Kravchuk
>            Priority: Blocker
>
> When ios media playing from a remote resource, used the avPlayer and there is no way
to change the volume.
> If media playing from local storage - volume control works.
> On Androind no such problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message