Forum Xamarin.iOS

AVPlayer: Can't play video in table view cell

Hello everybody, I am currently using this code im my TableViewSource:

    public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        var cell = (RFVideoTBC)tableView.DequeueReusableCell(RFVideoTBC.Identifier(), indexPath);

        var url = NSUrl.FromString("");

        AVPlayer player = AVPlayer.FromUrl(url);

        var playerViewController = new AVPlayerViewController();

        playerViewController.Player = player;
        playerViewController.View.Frame = new CoreGraphics.CGRect(16, 
                                                                  cell.Frame.Width - 32,

        playerViewController.ShowsPlaybackControls = false;


        return cell;

Player seems to be ready, the URL confirms to the HTTPS-protocol, player status is "ready to play".

But all I get is a black canvas:

What is wrong with my code? When I restart Xamarin, clean and rebuild the application, there is sometimes an
activity indicator working for 3 seconds, but the black canvas with the disabled play button returns.

Can't figure out why, tested playing a video on iOS 9 simulator and a my iPhone.

Best Answer


Sign In or Register to comment.