mergAVPlayerCreate Help.

This is the place to get technical support and discuss all things to do with MergEXT

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, monte

Post Reply
Posts: 9
Joined: Mon Apr 17, 2023 2:49 am

mergAVPlayerCreate Help.

Post by MxDx » Mon Apr 17, 2023 8:08 pm

I am using on currentTimeChanged theInterval to sync graphic objects in my app with the playback location of an audio file.
The player object is used for audio playback on Mac OS.
I need to implement this same functionality for the iOS platform.

I'm looking at mergAVPlayerCreate & mergAVPlayerCreatePeriodicTimeObserver to handle this.
#1 Is this the best way to implement it?
I'm still new to LC - the docs on these functions leaves me scratching my head.
#2 Are there any example files I might find somewhere. ( I've yet to find anything)

This is what I have so far - but it doesn't work. ( the path checks out)

Code: Select all

-- Path to the audio file
 01.  put specialFolderPath("engine") & "/Audio Files/myMP3File" into tFilePath   -- myMP3File is a placeholder.
   --   -- Create a new AVPlayer object  this line crashes LC
02.   put mergAVPlayerCreate("avPlayer", ) into tPlayerID
   -- Set the file path for the player
   set the fileName of player tPlayerID to tFilePath
   --   -- Start playing the audio file
 .03  play player tPlayerID[/indent]

Post Reply

Return to “MergEXT”