CreateMobileAudioPlayer - Fails on Mobile 9.6.0.dp1

Sannyasin Brahmanathaswami brahma at
Thu Nov 28 22:48:05 EST 2019

Rather than file a bug report, I think we can air this out here on the list first. then if it is a bug will file it.

This work on in 9.5.1 rc 1, but is failing on 9.6 dp1. I immediately crashes the app as soon as we pass the parameters to it. We are not using and the "no-longer-available"  commands noted in the release notes
"iOS mobile player control updated to use AVKit"

command createMobileAudioPlayer pURL, pPlayerName, pRect
	local tHeight,tPlayloc 
	if pPlayerName is among the lines of mobileControls() then
		mobileControlDelete pPlayerName -- init
	end if
	mobileControlCreate "player", pPlayerName
	put the result into sPlayerId
	if pRect is empty then
		put the rect of player pPlayerName into pRect 
	end if
	# set the play control without a controller present 
	-- adjust location for mobile:--### FIND OUT IF THIS IS NEEDED ON iOS
	if the platform is "android" then
		if the short name of this card is "surprise_audio" then
			subtract 70 from item 2 of pRect
			-- android player controls appear above the player; adjust
			-- with controller it's about 4x rect of cd player so align the bottom edges:
			# this is hard wired to the bottom of the card for now.
			put item 4 of pRect - item 2 of pRect into tHeight
			put CardHeight() - safeBottomMargin() - 70 into item 4 of pRect
			put (item 4 of pRect) - tHeight - 50 into item 2 of pRect
		end if
	end if
	put pRect into sPlayerRect
	mobileControlSet pPlayerName, "visible", false 
	mobileControlSet pPlayerName, "showcontroller", false
	mobileControlSet pPlayerName, "rect", pRect
	--mobileControlSet pPlayerName, "showController", true 
	mobileControlSet pPlayerName, "filename", pURL 
	if pURL begins with "https" then
		showBusyIndicator true, "Loading audio..."
			-- add loading indicator until duration is available
	end if
	if mobileIdleTimerLocked() is false then
		mobileLockIdleTimer --jg: disallow screen lock
	end if

Do you see anything wrong?

More information about the use-livecode mailing list