apache / apache/cordova-plugin-media

iOS - Recording audio without playing it back breaks HTML5 sound

Open
#263 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
391
Forks
762
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
Recording audio without playing it back breaks WebView audio playback on iOS

### What is expected to happen?
On iOS after recording audio without playing it back it should be possible to play HTML5 video/audio with sound.

### What does actually happen?
There is no sound when playing HTML5 video/audio after starting an audio record without playing it back

## Information
When you start a record the AVAudioSessionCategory ist set to AVAudioSessionCategoryRecord

When you then try to play a HTML audio/video Element it will not have sound as AVAudioSessionCategoryRecord does not allow audio output.

When the Cordova Media record is played back AVAudioSessionCategoryPlayback ist set and HTML5 audio will work again.

### Environment, Platform, Device
iOS

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start at the iOS recording entry point and trace where AVAudioSessionCategoryRecord is set. Reproduce the issue by recording without playback, then play HTML5 audio or video; done means sound remains available after recording without requiring Cordova Media playback.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.