Skip to content

Commit

Permalink
add another option to load (dlopen) avf
Browse files Browse the repository at this point in the history
  • Loading branch information
BarVaserman committed Feb 12, 2022
1 parent c3886c1 commit 2953f5d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rpcclient/rpcclient/darwin/darwin_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ def __init__(self, client):
:param rpcclient.client.darwin_client.DarwinClient client:
"""
self._client = client

if 0 == client.dlopen('/System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio', 2):
raise RpcClientException('failed to load AVFAudio')
self._load_av_foundation()

def _load_av_foundation(self):
options = ['/System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation',
'/System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio']
for option in options:
if self._client.dlopen(option, 2):
return
raise RpcClientException('failed to load AVFAudio')

def set_audio_session(self):
AVAudioSession = self._client.symbols.objc_getClass('AVAudioSession')
Expand Down

0 comments on commit 2953f5d

Please sign in to comment.