apache / apache/cordova-plugin-media

[iOS] Audio stream (http) keeps playing when app/page reloads

Open
#342 0 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
On iOS, when playing a remote audio stream (e.g. HTTP) and reloading the page content, the audio playback keeps playing and there's no way to stop it from JS, except killing the app.

### What is expected to happen?
Audio should stop on app reset (like on Android).

### What does actually happen?
Audio keeps playing on app reset.

## Information
This is somewhat related to https://github.com/apache/cordova-plugin-media/issues/294, although the cause is slightly different: `onReset` does not clean-up `avPlayer` and only takes care of local sounds (where `audioFile.player` is not `nil`).

### Version information
- cordova-plugin-media 5.0.4
- iOS 15

## 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

Inspect the iOS onReset handling and the avPlayer cleanup path mentioned in the issue, then compare it with the Android reset behavior. Reproduce the problem with an HTTP audio stream and a page reload; the work is done when app reset stops playback and it can be controlled again from JavaScript.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.