ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
487 stars 395 forks source link

HTML Audio, Video tag doesn't working properly with the local or cloud audio file on iOS #652

Open MozzazIncorporation opened 3 years ago

MozzazIncorporation commented 3 years ago

Hello Team,

We were using ionic webview plugin to support the WKWebView in our app. But seems like it causing the issue of audio and video html tag doesn't working properly.

Issue: The volume of the audio/video is very quiet, can barely hear it (with the system volume is maximum).

Component Code: function playAudio(audioUrl) {

$scope = $rootScope.$new();
var audio_name = audioUrl.split("/");
audio_name = audio_name[audio_name.length - 1]

var audioCtrlTemplate =
  '<ion-modal-view class="audio_modal">' +  
    '<ion-header-bar class="bar bar-header" style="height: 44px !important;">' +
      //'<h1 class="title">'+ audio_name +'</h1>' +
      '<button style="position:absolute; right: 10px;" class="button button-clear button-primary" ng-click="closeModal()">Cancel</button>' +
    '</ion-header-bar>' +
    '<ion-content data-tap-disabled="true" scroll="false" style="text-align:center; line-height:100px; height:100px; padding-top: 10px">' +
      '<audio id="audio-'+audio_name+'" class="audio-player" controls>' + 
        '<source src="'+ audioUrl+'" type="audio/mpeg">' +
      '</audio>' +
    '</ion-content>' +
  '</ion-modal-view>'; 

var modal = $ionicModal.fromTemplate(audioCtrlTemplate, {
    scope: $scope,
    animation: 'popIn',
    backdropClickToClose: false        
});

$scope.closeModal = function() {
    modal.hide();
};

var modalIsRemoved = false;
$scope.$on('modal.hidden', function() {
  if (modalIsRemoved)
    return;
  modalIsRemoved = true;
  modal.remove();
});

$scope.$on('modal.shown', function() {
  document.getElementById('audio-'+audio_name).play();
});

modal.show();

}

Error Log> 2021-10-04 15:11:37.411878+0530 Lifetiles Pro[425:10893] [ProcessSuspension] 0x109cd08a0 - ProcessAssertion: Failed to acquire RBS MediaPlayback assertion 'WebKit Media Playback' for process with PID 425, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}

P.S> It was working before as expected.

Lyfei commented 1 year ago

solved?