Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a WKWebView based example #10

Closed
wants to merge 15 commits into from

Conversation

dodikk
Copy link

@dodikk dodikk commented Jul 30, 2018

WKWebView does not need this POD to achieve the same thing.
Still, I think the example and a readme mention might be useful.

Based on #9
After merging that one, the diffs should become more brief.

@dodikk
Copy link
Author

dodikk commented Jul 30, 2018

The "foo/bar" example with basic authorization works fine in WKWebView.
However, my "video with authorization" example fails (while it works fine with UIWebView and this library).

I'll push more commits when I discover the correct settings for WKWebView.

@dodikk
Copy link
Author

dodikk commented Jul 30, 2018

Using an isolated non-persistent site data store pops up the alert for NTLM but that does not help the playback yet.

WKWebViewConfiguration* config = [WKWebViewConfiguration new];
    config.allowsInlineMediaPlayback = YES;
    config.allowsPictureInPictureMediaPlayback = NO;
    config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
    config.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];

@dodikk
Copy link
Author

dodikk commented Jul 31, 2018

Using an isolated non-persistent site data store pops up the alert for NTLM but that does not help the playback yet.

Never mind, the video's URL scheme was http which is "banned" by default due to Apple security policy. So that the exceptions should be added explicitly.

Alternatively, JavaScript injection could be used if the server can serve videos via https. For example, https://gist.github.com/dodikk/e028c03cd809271c950c135a3abd4240

The config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll; and Deployment Target >= iOS 10.0 are impactful as well. Without those options the legacy project did not play the video while the prototype from this pull request did work.

Copy link
Collaborator

@hborders hborders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor request.

[self.webView loadRequest: request];
}

#pragma mark - JAHPAuthenticatingHTTPProtocolDelegate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should bring JAHPAuthenticatingHTTPProtocolDelegate into this at all. It isn't needed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the mentioned #pragma mark

@dodikk
Copy link
Author

dodikk commented Aug 3, 2018

Will be merged as part of a more recent PR #11

@dodikk dodikk closed this Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants