-
Notifications
You must be signed in to change notification settings - Fork 104
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
Feature Request: Play video on Phone from Kodi Library #702
Comments
There was an unfinished attempt to play file via VLC, the code got removed. Adding this feature is not on my agenda yet, but I understand this can be useful. Any help to add this is appreciated. |
Just did a quick hack, and this already plays my flac audio files, but it refuses to play the mpg and mkv files I have. I guess https://github.com/wutschel/Official-Kodi-Remote-iOS/tree/local_playback Edit: Also confirmed this works with 3pg videos. |
yes, you're right. I think it'd be better to add a Share button sending video URL or so that can be transferred to an external video player app capable of handling such format. |
Why not. Added the long press action "Share" which for now only allows to copy-to-clipboard. https://github.com/wutschel/Official-Kodi-Remote-iOS/tree/share_url Screenshot: https://abload.de/img/bildschirmfoto2022-10olfus.png Is it possible to let iOS select which apps are relevant for the file type the URL points to? |
I think not, unfortunately. But please test with a few video player apps and sharing video links from other apps. On the commit:
|
Thanks for your comments. I just started to play around with this a bit and will improve this further. Finally I need to test on my phone as on simulator I don't have any other apps running. |
Updated the implementation, mainly addressing the origin and not disabling mail/message/airdrop. Can you help with how to update icon? I did not find reference obj c code around |
here's a URL wrapper from one of my projects, hope this would be sufficient to get the idea: // .h
@interface SharingActivityItemSource : NSObject <UIActivityItemSource>
- (instancetype)initWithUrlString:(NSString *)urlString;
@end
// .m
@import LinkPresentation;
@interface SharingActivityItemSource ()
@property (nonatomic, copy) NSURL *url;
@end
@implementation SharingActivityItemSource
- (instancetype)initWithUrlString:(NSString *)urlString {
if (self = [super init]) {
self.url = [NSURL URLWithString:urlString];
}
return self;
}
- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController {
return self.url;
}
- (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType {
return self.url;
}
- (LPLinkMetadata *)activityViewControllerLinkMetadata:(UIActivityViewController *)activityViewController API_AVAILABLE(ios(13.0)) {
__auto_type meta = [LPLinkMetadata new];
meta.originalURL = self.url;
meta.URL = meta.originalURL;
meta.title = @"Artikel";
meta.imageProvider = [[NSItemProvider alloc] initWithContentsOfURL:NSBundle.mainBundle.appIconURL];
return meta;
}
@end and then you pass an instance of this class instead of plain URL to iirc there're more fields in LPLinkMetadata, please check its doc/header. |
Thanks, tried to add this to my best knowledge (see https://github.com/wutschel/Official-Kodi-Remote-iOS/tree/share_url), but this crashes with "*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SharingActivityItemSource copyWithZone:]: unrecognized selector sent to instance 0x600001b00620'". If I implement it crashes with the next unrecognized selector. Did I miss something? |
you made a mistake: |
and now with LPLinkMetadata you can control title ( |
Yep, next step. But this might be a viable overall solution. Still need to test how this behaves when sharing the URL with other apps. Do you have by chance the possibility to test? |
yes, will try on iPad, have a few video players there |
tested on iPad: seems to work, opening the URL in VLC works as well. Unfortunately, plain URL can't be sent to video players out of the box, probably unless they implement a share extension.
But now I see that thumbnails are usually unavailable, I'd avoid delays in showing the sharing view as it's a rather bad UX (at first I thought that sharing simply doesn't work and tried it a couple of times). Can be shown only if already available in local cache (if there's such thing in the Remote). |
|
Now, Kore for Android can play video on Phone from Kodi Library.
Can Official-Kodi-Remote-iOS also add this feature?
The text was updated successfully, but these errors were encountered: