cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

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

Open MozzazIncorporation opened this issue 4 years ago • 1 comments

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.

MozzazIncorporation avatar Oct 04 '21 09:10 MozzazIncorporation

solved?

Lyfei avatar Apr 14 '23 03:04 Lyfei