[SOLVED] AVPlayer - have sound, but no video lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- trev · 2020-08-08 09:31 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.PlayButtonClick(Sender: TObject);begin  //  // 1. Create a URL  //  URL := NSURL.URLWithString(NSSTR(PAnsiChar('https://devstreaming-c dn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/maste r.m3u8')));  if(Url = Nil) then    ShowMessage('NSURL.URLWithString failed!');   //  // 2. Create AVPlayer object  //  myAsset := AVAsset.alloc.assetWithURL(URL);  myPlayerItem := AVPlayerItem.alloc.initWithAsset(myAsset);  myPlayer := AVPlayer.alloc.initWithPlayerItem(myPlayerItem);   while(myPlayer.Status = AVPlayerStatusUnknown)    do      application.processmessages;   if(myPlayer.Status = AVPlayerStatusFailed) then    ShowMessage('AVplayer status: failed')  else if(myPlayer.Status = AVPlayerStatusReadyToPlay) then    ShowMessage('AVplayer status: ready to play');   //  // 3. Creete playerView object to display video  //  myPlayerView.alloc.setPlayer(myPlayer);  myPlayerView.setControlsStyle(1);  // inline   if(myPlayerView.isReadyForDisplay) then    ShowMessage('AVPlayerView ready for display')  else    ShowMessage('AVPlayerView not ready for display');   //  // 4. Play  //  myPlayer.play;end; I thought this ws going to be simple but I was only half right - I have sound, but no video. * AVplayer status: ready to play - yes * AVPlayerView ready for display - no (delay before makes no difference) Obviously there's something wrong with my AVPlayerView setup. Any ideas? ---------------------------------------------------------------------- trev · 2020-08-17 07:58 Slightly further forward. I finally noticed that: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i myPlayerView.alloc.setPlayer(myPlayer); need to be changed to: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  myPlayerView := AVPlayerView.alloc.initWithFrame(CGRectMake(0,0,500,5 00));myPlayerView.setPlayer(myPlayer); to actually create myPlayerView ... but still no video ---------------------------------------------------------------------- trev · 2021-11-03 11:57 It took a while, but having slept on it for 120 days, I realised what I was missing :-) See the Wiki article macOs Video Player for code examples using AVplayerView (standard video player controls) and the alternative AVPLayerLayer (custom video player controls).