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

Streaming Video #53

Open
EmrahKK opened this issue Sep 9, 2014 · 2 comments
Open

Streaming Video #53

EmrahKK opened this issue Sep 9, 2014 · 2 comments

Comments

@EmrahKK
Copy link

EmrahKK commented Sep 9, 2014

Is there a specific way of streming video in owncloud ios library? I 'm using below code to stream video from our owncloud server.

@Property (nonatomic, strong) MPMoviePlayerController *moviePlayerController;
.
.
.

  • (void)openVideo {
    NSString* filePath = [self.videoItem.filePath stringByAppendingString:self.videoItem.fileName];

    // fileurl is full path of a video file like "http://xxxx.com/remote.php/webdav/video.mp4"

    NSURL* fileurl=[NSURL URLWithString:[[[BoxAPI sharedBoxAPI] serverUrl] stringByAppendingString:filePath]];

    NSLog(@"opening video at > %@",[[[BoxAPI sharedBoxAPI] serverUrl] stringByAppendingString:filePath]);

    self.moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL: fileurl];

    self.moviePlayerController.fullscreen = YES;
    self.moviePlayerController.movieSourceType = MPMovieSourceTypeFile;
    self.moviePlayerController.view.frame = self.view.bounds;

    [self.view addSubview:self.moviePlayerController.view];
    [self.moviePlayerController play];

    [[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(videoFinished:)
    name:MPMoviePlayerPlaybackDidFinishNotification
    object:self.moviePlayerController];
    }

-(void)videoFinished:(NSNotification*)notification
{
NSLog(@"Video end..");
}

but I'm getting

2014-09-09 09:40:42.491 ibb box[4021:60b] _itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}

video does not play. I'm setting credidentals with

  • [[AppDelegate sharedOCCommunication] setCredentialsWithUser:[self user] andPassword:[self password]];

    method before making request. I couldn't find any solution to this. please help..

@javiergonzper
Copy link
Contributor

To do that the server should provide us a way to obtain a direct URL to access to de the file without need athentication.
Maybe you could open this on the core linking this issue.

@supportreq
Copy link

@nasli @EmrahKK It seems to be possible by passing the username and password directly with the http request.. check the implementation in android app owncloud/android#592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants