Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   XE4 auf iOS (https://www.delphipraxis.net/178564-xe4-auf-ios.html)

Peter666 15. Jan 2014 09:33

XE4 auf iOS
 
Hi,

ich versuche mich gerade in die Materie einzulesen und möchte einen Radiostream auf einem Tablet abspielen und zwar im Hintergrund. Die Wiedergabe funktioniert und auch im Hintergrundbetrieb. Dafür muss man ja nur
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
in die PList eintragen. Nun möchte ich aber auch das die Audiokontrollen wie Stop/Play und Lautstärke im Sperrbildschirm dargestellt werden. Dafür sollte man, laut Apple via
sharedApplication.beginReceivingRemoteControlEvent s beim Verstecken des Views aufrufen und sharedApplication.endReceivingRemoteControlEvents sobald das View wieder sichtbar wird. Also bei OnHide bzw. OnShow. Leider geht das ganze nicht und ich habe die Befürchtung das es daran liegt, dass ich noch das remoteControlReceivedWithEvent implementieren muss. Hat das jemand schon einmal gemacht?

Peter666 15. Jan 2014 11:13

AW: XE4 auf iOS
 
Was übrigens auch nicht geht ist das hier:

Delphi-Quellcode:
  LNowPlayingInfoCenter := TMPNowPlayingInfoCenter.Wrap
    (TMPNowPlayingInfoCenter.OCClass.defaultCenter);
  if LNowPlayingInfoCenter <> nil then
  begin
    LDict := TNSMutableDictionary.Create;
    try
      LDict.setObject((NSStr('Title') as ILocalObject).GetObjectID,
        (NSStr('MPMediaItemPropertyTitle') as ILocalObject).GetObjectID);
      LDict.setObject((NSStr('Artist') as ILocalObject).GetObjectID,
        (NSStr('MPMediaItemPropertyArtist') as ILocalObject).GetObjectID);
      LDict.setObject((NSStr('Album') as ILocalObject).GetObjectID,
        (NSStr('MPMediaItemPropertyAlbumTitle') as ILocalObject).GetObjectID);

      LNowPlayingInfoCenter.setNowPlayingInfo(LDict);
    finally
      LDict.release;
    end;
  end;
Ich verstehe das nicht, das sollte doch selbst mit XCode laufen :(

CHackbart 16. Jan 2014 08:41

AW: XE4 auf iOS
 
MPMediaItemPropertyTitle ist nur eine Konstante mit dem Wert title, nimm den anstelle.
Probier mal beginreceivingcomponent am Anfang, also andersherum. Die angesprochene remotecontrol Funktion musst du implementieren, dass geht leider nicht anders. Ich wüsste aber jetzt auch nicht wie.


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:30 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz