youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.64k stars 680 forks source link

Player only plays for one second. #443

Open doriansgithub opened 2 years ago

doriansgithub commented 2 years ago

Player only plays for one second. If I pause the process, it plays normal. Any ideas?

UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}

steven-worrall commented 2 years ago

I'm having a very similar problem, the player will load up fine but once I try to play the content I get a bunch of errors.

[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}>

[ProcessSuspension] 0x10a3b30f0 - ProcessAssertion: Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=74905, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}

doriansgithub commented 2 years ago

Exactly the same here.

Sent from my iPhone

On Nov 10, 2021, at 1:56 PM, steven-worrall @.***> wrote:

 I'm having a very similar problem, the player will load up fine but once I try to play the content I get a bunch of errors.

[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}>

[ProcessSuspension] 0x10a3b30f0 - ProcessAssertion: Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=74905, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

developingbrian commented 2 years ago

Im getting the same errors about entitlements. This is on iOS 15.

gondp commented 2 years ago

Same problem. Solution? iOS 15.1

developingbrian commented 2 years ago

Same problem. Solution? iOS 15.1

Im seeing the same errors on 15.1 unfortunately.

schradeyannik commented 2 years ago

Same here

numerized commented 2 years ago

same problem here

dj-fiorex commented 2 years ago

Same problem for me, with this library and with another project that use plain web audio api.

themcaguy commented 2 years ago

Did anyone find any solution to this problem? I am also facing the same.

saltyskip commented 2 years ago

Any updates?

CanfieldMobileDev commented 2 years ago

My app is having these problems playing videos inside a web view running on a webpage supplied by a 3rd party.

While researching this issue and not finding any answers, only questions, I have run into this article. It directly addresses the apparent culprit - "RunningBoard: a new subsystem in Catalina to detect errors".

I am going over it now. Perhaps others also can try to make sense of it.

Skylark4Sky commented 2 years ago

same here

villyGreen commented 2 years ago

Same problems

daniellivingston commented 2 years ago

Solution: set NSAllowsArbitraryLoadsInWebContent to true.

In your Info.plist file, enable the property list key NSAllowsArbitraryLoadsInWebContent as follows:

    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>

If that doesn't work, try going overboard and disabling all relevant App Transport Security restrictions (and then, of course, re-enabling all non-breaking security measures once the problem is isolated):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSAllowsArbitraryLoadsForMedia</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>
</plist>
shto commented 2 years ago

Solution: set NSAllowsArbitraryLoadsInWebContent to true.

In your Info.plist file, enable the property list key NSAllowsArbitraryLoadsInWebContent as follows:

  <key>NSAllowsArbitraryLoadsInWebContent</key>
  <true/>

If that doesn't work, try going overboard and disabling all relevant App Transport Security restrictions (and then, of course, re-enabling all non-breaking security measures once the problem is isolated):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>NSAllowsArbitraryLoadsForMedia</key>
  <true/>
  <key>NSAllowsArbitraryLoadsInWebContent</key>
  <true/>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
  <key>NSAllowsLocalNetworking</key>
  <true/>
</dict>
</plist>

@daniellivingston Enabled all, but still getting the assertion.

daniellivingston commented 2 years ago

@shto Sorry, I misspoke. They should be in your Entitlements.plist, not Info.plist. If you don't have an Entitlements file, you can add & manipulate one under Target -> Capabilities: https://stackoverflow.com/a/32547306/5150303

andypotato commented 2 years ago

@daniellivingston setting these entitlements will get your App rejected unless you provide a justification during submission

See details here: https://developer.apple.com/documentation/security/preventing_insecure_network_connections

daniellivingston commented 2 years ago

@daniellivingston setting these entitlements will get your App rejected unless you provide a justification during submission

See details here: https://developer.apple.com/documentation/security/preventing_insecure_network_connections

Yes, but AFAIK they're the only officially sanctioned way to address this issue.

At the very least, it's an unblocker.

robm92 commented 2 years ago

Attempted the above in both info.plist and entitlements with no luck.

danielchangsoojones commented 2 years ago

having the same issue here @daniellivingston. Also, when I try and add the NSAllowsArbitraryLoadsForMedia, etc. to my entitlement files, I can't get it to run on my device because it errors with a provisioning profile error:

Screen Shot 2022-06-30 at 11 57 54 PM

Any solutions?

RaffiRincon commented 1 year ago

What helped me was adding this to my Info.plist:

image