Issue with hls and resume buttons

Hello. I am experiencing an issue where the “resume” and “start from the beginning” buttons appear when a live feed has been exited. The buttons behave as expected on mp4 content but I am trying to remove them from live feeds which are supplied through a xml file. Can someone point me in the right direction? Thanks.

appShowFeed.brs


        'fetch all values from the xml for the current show
        item.hdImg            = validstr(curShow@hdImg) 
        item.sdImg            = validstr(curShow@sdImg) 
        item.ContentId        = validstr(curShow.contentId.GetText()) 
        item.Title            = validstr(curShow.title.GetText()) 
        item.Description      = validstr(curShow.description.GetText()) 
        item.ContentType      = validstr(curShow.contentType.GetText())
        item.ContentQuality   = validstr(curShow.contentQuality.GetText())
        item.Synopsis         = validstr(curShow.synopsis.GetText())
        item.Genre            = validstr(curShow.genres.GetText())
        item.Runtime          = validstr(curShow.runtime.GetText())
        item.HDBifUrl         = validstr(curShow.hdBifUrl.GetText())
        item.SDBifUrl         = validstr(curShow.sdBifUrl.GetText())
        item.StreamFormat = validstr(curShow.streamFormat.GetText())
        item.SwitchingStrategy = validstr(curshow.switchingStrategy.gettext())
        if item.StreamFormat = "" then  'set default streamFormat to mp4 if doesn't exist in xml
            item.StreamFormat = "mp4"
            elseif item.StreamFormat = "hls" then
            item.StreamFormat = "hls"
            item.SwitchingStrategy="full-adaptation"
        endif

appVideoScreen.brs


 
Function showVideoScreen(showList As Object, showIndex as Integer)
    if validateParam(showList, "roArray", "refreshShowDetail") = false return -1
    episode = showList[showIndex]
  '  if (not BillReminder()) then return invalid
'   Track(episode["contentId"])
    port = CreateObject("roMessagePort")
    screen = CreateObject("roVideoScreen")
    screen.SetMessagePort(port)

    screen.SetPositionNotificationPeriod(30)
    screen.SetContent(episode)
    screen.Show()

    'Uncomment his line to dump the contents of the episode to be played
     PrintAA(episode)

    while true
        msg = wait(0, port)

        if type(msg) = "roVideoScreenEvent" then
            print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
            if msg.isScreenClosed()
                print "Screen closed"
                exit while
			elseif msg.isfullresult()
				 RegDelete(episode.ContentId)
            elseif msg.isRequestFailed() then
				showVideoFailureMessage()
                'print "Video request failure: "; msg.GetIndex(); " " msg.GetData() 
            elseif msg.isStatusMessage()
                print "Video status: "; msg.GetIndex(); " " msg.GetData() 
            elseif msg.isButtonPressed()
                print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
            elseif msg.isPlaybackPosition() then
                nowpos = msg.GetIndex()
                RegWrite(episode.ContentId, nowpos.toStr())
            else
                print "Unexpected event type: "; msg.GetType()
            end if
        else
            print "Unexpected message class: "; type(msg)
        end if
    end while

End Function

appDetail.brs


Function refreshShowDetail(screen As Object, showList As Object, showIndex as Integer) As Integer

    if validateParam(screen, "roSpringboardScreen", "refreshShowDetail") = false return -1
    if validateParam(showList, "roArray", "refreshShowDetail") = false return -1

    show = showList[showIndex]
    'Uncomment this statement to dump the details for each show
    PrintAA(show)
	
    if show.contentformat <> "audio"
        screen.ClearButtons()
       if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 then
           screen.AddButton(1, "Resume Playing")    
          screen.AddButton(2, "Play from Beginning")  
         screen.SetStaticRatingEnabled(false)	
         else
            screen.addbutton(2,"Play")
	        screen.SetStaticRatingEnabled(false)
        end if
        screen.SetContent(show)
        screen.Show()
    else
        screen.ClearButtons()
        if(m.playing = 1) then 
            if(m.paused = 0) then
                screen.AddButton(1, "Pause")
            else
                screen.AddButton(1, "Resume")
            end if
            screen.AddButton(3, "Stop")
        else
            screen.AddButton(2, "Play")
        end if
        screen.SetContent(show)
        screen.SetStaticRatingEnabled(false)
        screen.Show()
    endif
End Function