             actions.append(action)
         }
         self.createAlert(with: actions, and: "Legendas")
+    }
+    
+    func configureCastTopBar(outputsCount: Int) {
+        castPlayerController?.removeActionButton(byName: "menuOptions")
+        castPlayerController?.removeActionButton(byName: "Live")
+        castPlayerController?.removeActionButton(byName: "CAST_BUTTON")
+        if !media.isAudio {
+            if outputsCount > 2 || !media.isLive || media.captions?.count ?? 0 > 0{
+                if !_hiddenPlayerControls.contains(.menu) {
+                    castPlayerController?.addActionButton(with: GMFResources.playerTopBarMenuImage(), name: "menuOptions", target: self, selector: #selector(createOptionsMenu))
+                }
+                if isChromecastEnable {
+                    castPlayerController?.addActionButton(with: nil, name: "CAST_BUTTON", target: nil, selector: nil)
+                }
+            }
+            if media.isLive {
+                if !_hiddenPlayerControls.contains(.liveIcon) {
+                    castPlayerController?.addActionButton(with: GMFResources.playerTitleLiveIcon(), name:"Live", target:self, selector:#selector(realtimeButtonHandler))
+                }
+                
+                if isChromecastEnable {
+                    castPlayerController?.addActionButton(with: nil, name: "CAST_BUTTON", target: nil, selector: nil)
+                }
+            }
+        }
     }
     
 	

    }
    
    @objc private func hdCastTouchHandler() {
        
    }
    
    @objc private func captionsCastTouchHandler() {

        if hiddenControls.contains(.time) {
            player.getControlsView().hideTime()
        }
        if isPlayerCast {
            configureCastTopBar(outputsCount: _outputManager?.menuItems.count ?? 0)
        } else {
            configureTopBar(outputsCount: _outputManager?.menuItems.count ?? 0)
        }
        
    }
	
	private class OutputManager : SambaPlayerDelegate {
