SWRecordedBroadcastViewController

class SWRecordedBroadcastViewController : SWBaseViewController, UIGestureRecognizerDelegate

Undocumented

  • UIView used to contain AVPlayerLayer to show video on UI.

    Declaration

    Swift

    @IBOutlet
    weak var playerView: UIView!
  • UILabel to show elapsed time over total broadcast time.

    Declaration

    Swift

    @IBOutlet
    weak var timerLabel: UILabel!
  • Undocumented

    Declaration

    Swift

    @IBOutlet
    weak var totalBroadcastDuration: UILabel!
  • UIButton to close this view.

    Declaration

    Swift

    @IBOutlet
    weak var leaveButton: UIButton!
  • NSLayoutConstraint to animate close button when scroll pages.

    Declaration

    Swift

    @IBOutlet
    weak var leaveButtonRightConstraint: NSLayoutConstraint!
  • UIView used to dim the whole view when player is paused or reach end.

    Declaration

    Swift

    @IBOutlet
    weak var dimmingView: UIView!
  • UISlider used to show and change current player time.

    Declaration

    Swift

    @IBOutlet
    weak var playerSlider: SWCustomUISlider!
  • Undocumented

    Declaration

    Swift

    var isPaused: Bool
  • UIView at the bottom. Contains messagesBtn, playPauseBtn and activityBtn

    Declaration

    Swift

    @IBOutlet
    weak var bottomControlsView: UIView!
  • commentsbar height constraints which contains the comments bar/ play pause and activity button

    Declaration

    Swift

    @IBOutlet
    weak var commentsBarHeightConstraints: NSLayoutConstraint!
  • commentsbar view which contains the comments bar/ play pause and activity button

    Declaration

    Swift

    @IBOutlet
    weak var commentsBarView: UIView!
  • UIButton at view’s bottom. Should show action sheet with options depends on current user when clicked.

    Declaration

    Swift

    @IBOutlet
    weak var activityBtn: UIButton!
  • UIButton to play pause.

    Declaration

    Swift

    @IBOutlet
    weak var playPauseBtn: UIButton!
  • UIImageView used to show gradient shadow at viw’s top.

    Declaration

    Swift

    @IBOutlet
    weak var gradientTopIV: UIImageView!
  • <#Description#>

    Declaration

    Swift

    @IBOutlet
    weak var informativeView: UIView!
  • <#Description#>

    Declaration

    Swift

    @IBOutlet
    weak var informativeProgressBarView: UIView!
  • <#Description#>

    Declaration

    Swift

    @IBOutlet
    weak var informativeLabel: UILabel!
  • <#Description#>

    Declaration

    Swift

    @IBOutlet
    weak var informativeProgressBarLeftConstraint: NSLayoutConstraint!
  • <#Description#>

    Declaration

    Swift

    @IBOutlet
    weak var informativeProgressBarRightConstraint: NSLayoutConstraint!
  • Undocumented

    Declaration

    Swift

    @IBOutlet
    weak var commentButton: UIControl!
  • Undocumented

    Declaration

    Swift

    @IBOutlet
    weak var commentPlaceholder: UILabel!
  • Undocumented

    Declaration

    Swift

    @IBOutlet
    weak var userIcon: UIImageView!
  • Associated broadcast

    Declaration

    Swift

    var stream: SWStream!
  • Duration to be used for playing associated stream. Which is minumum value duration of either player asset (video file) duration or stream duration retrieved from backend.

    Declaration

    Swift

    var streamMinDuration: Double { get }
  • Undocumented

    Declaration

    Swift

    var overlayCommentVC: SWOverlayCommentsViewController?
  • UIView to hold all paging views.

    Declaration

    Swift

    var pagingView: UIView!
  • Boolean value to disable / enable paging scrolling.

    Declaration

    Swift

    var isPagingScrollDisabled: Bool
  • Begin point of pan gesture.

    Declaration

    Swift

    var panBeginPoint: CGPoint!
  • Undocumented

    Declaration

    Swift

    var playPauseTime: Double
  • Index of current page. Takes values 0, -1, -2. Default value is -1

    Declaration

    Swift

    var currentPageIndex: CGFloat
  • Undocumented

    Declaration

    Swift

    var pagingBeginPanFrame: CGRect!
  • Boolean value used to keep Page0 UI controls hidden when fadeOutPageZeroUIControls is called until fadeInPageZeroUIControls is called

    Declaration

    Swift

    var isPage0ControlsHidden: Bool
  • Reference to Live Messaging view controller

    Declaration

    Swift

    var liveMessagingViewController: SWLiveMessagingViewController!
  • Undocumented

    Declaration

    Swift

    var mergedDetailsVC: SWMergedBroadcastDetailsViewController!
  • Reference to Processing view controller, it is nil as long as processing view is not shown yet.

    Declaration

    Swift

    var processingVC: KLProcessingScreenViewController?
  • Undocumented

    Declaration

    Swift

    var scheduledOrProcessingVC: SWScheduleOrProcessingViewController?
  • Reference to bottom overlay view controller to display the actions required for the broadcast

    Declaration

    Swift

    var overlayViewController: SWBroadcastOverlayViewController!
  • Reference to claps view controller to display the claps when the activity is happening

    Declaration

    Swift

    var clapsViewController: SWClapsViewController!
  • AVPlayer used to play and control recorded broadcast.

    Declaration

    Swift

    var player: AVPlayer?
  • Reference to hold current AVPlayerItem to make sure it is never deallocated before removering the observers.

    Declaration

    Swift

    var playerItem: AVPlayerItem?
  • AVPlayerLayer used to show recorded broadcast at the view.

    Declaration

    Swift

    var playerLayer: AVPlayerLayer?
  • Reference to timer used to observer player playing progress. Player timer observer should be remove from AVPlayer when dismissing this view.

    Declaration

    Swift

    var playerTimeObserver: Any?
  • Reference to observer used to detect when playing reach end (streamMinDuration)

    Declaration

    Swift

    var playerBoundaryObserver: Any?
  • Firebase reference in order to get the likes and views cout

    Declaration

    Swift

    var broadcastingReference: DatabaseReference!
  • firebase reference in order to get the viewers list

    Declaration

    Swift

    var broadcastViewerReference: DatabaseReference!
  • Undocumented

    Declaration

    Swift

    var broadcastChatStatusReference: DatabaseReference!
  • firebase reference in order to get the attachments list

    Declaration

    Swift

    var broadcastAttachmentsReference: DatabaseReference!
  • this variable tells the player that the video can be played as the initial call to the server has already being done

    Declaration

    Swift

    var videoShouldBePlayed: Bool
  • this is required to keep a track of the time watched by the broadcaster

    Declaration

    Swift

    var broadcastWatchStartTimer: Date?
  • this variable is used to stop the broadcast which is being loaded in background and playing even when broadcast is stopped by the user

    Declaration

    Swift

    var videoStopped: Bool
  • Indicates if player is buffer or not. Used to show informative view with BUFFERING title.

    Declaration

    Swift

    var isBuffering: Bool
  • indiates the device orientation

    Declaration

    Swift

    var deviceOrientation: UIInterfaceOrientation
  • indicates and allows the user to change the orientation of the broadcast

    Declaration

    Swift

    @IBOutlet
    weak var orientationButton: UIButton!
  • this constraints is used to give the animation effect when the viewes are swiped

    Declaration

    Swift

    @IBOutlet
    weak var orientationButtonLeadingConstraints: NSLayoutConstraint!
  • indicates the number of pages added in view controller; currently its 3 (-1, 0, +1)

    Declaration

    Swift

    var numberOfpages: CGFloat
  • refresh the plus one screen when you scroll to plus one screen

    Declaration

    Swift

    var refreshPlusOneScreen: Bool
  • Undocumented

    Declaration

    Swift

    var viewModel: SWRecordedViewModel!
  • Undocumented

    Declaration

    Swift

    var logginInitiator: LoginInitiator
  • Undocumented

    Declaration

    Swift

    var mutedUser: Set<String>
  • Undocumented

    Declaration

    Swift

    var isCurrentUserMuted: Bool
  • Undocumented

    Declaration

    Swift

    var isCommentsDisabled: Bool
  • Undocumented

    Declaration

    Swift

    override var shouldAutorotate: Bool { get }
  • Undocumented

    Declaration

    Swift

    fileprivate let animator: SWAnimator
  • Undocumented

    Declaration

    Swift

    @IBOutlet
    weak var backgroundImageView: UIImageView!
  • Show light content status bar.

    Declaration

    Swift

    override var preferredStatusBarStyle: UIStatusBarStyle { get }
  • Handler to tapping playPauseBtn.

    Declaration

    Swift

    @IBAction
    func playPauseBtnTapped(_ sender: Any)

    Parameters

    sender

    <#sender description#>

  • Handler to tapping close button. It should dismiss this view controller and release any used memory.

    Declaration

    Swift

    @IBAction
    func closeBtnClicked(_ sender: Any)

    Parameters

    sender

    <#sender description#>

  • Undocumented

    Declaration

    Swift

    func getElapsedTime() -> Int?
  • Undocumented

    Declaration

    Swift

    func deallocAVPlayer()
  • Should open action sheet with the following options.

    • Share (all users)
    • Invite (Broadcaster)
    • Report (Viewers)

    Declaration

    Swift

    @IBAction
    func activityBtnClicked(_ sender: Any)

    Parameters

    sender

  • Handler for tapping messages button. It should show messages view; which is part of comment view controller.

    Declaration

    Swift

    @IBAction
    func commentBtnClicked(_ sender: Any?)

    Parameters

    sender

    <#sender description#>

  • Undocumented

    Declaration

    Swift

    func openComments()
  • Undocumented

    Declaration

    Swift

    func setCommentsVCCallbacks()
  • Handler for tapping mute speaker button. It should toggle state of muting the speaker.

    Declaration

    Swift

    func muteSpeakerBtnClicked()

    Parameters

    sender

    <#sender description#>

  • Fade out all UI controls related to Page 0

    Declaration

    Swift

    func fadeOutPageZeroUIControls()
  • hides all the page 0 controls and displays the acitiybutton by bringing it in front used for RIP

    Declaration

    Swift

    func showOnlyLeaveButton()
  • Fade in all UI Controls related to Page 0

    Declaration

    Swift

    func fadeInPageZeroUIControls()
  • Pause AVPlayer and update this view’s UI to paused state.

    Declaration

    Swift

    @objc
    func pausePlaying()
  • Handler for tracking (change value of) player slider. This method should seek playing broadcast to match new slider value. UISlider isContinuous should be false to seek the player only when slider is released.

    Declaration

    Swift

    @objc
    func playerSliderValueChanged(slider: UISlider, event: UIEvent)

    Parameters

    slider

    <#slider description#>

  • Undocumented

    Declaration

    Swift

    func setupBroadcastingReference()
  • Undocumented

    Declaration

    Swift

    private func updateLoggedInUserstatus()
  • This function is called when player reach end of associated broadcast. It is used to show Replay button.

    Declaration

    Swift

    @objc
    func playerDidReachEnd()
  • Ignore taping main view when some modal view is added (custom action sheet) or when current page is not Page0

    Declaration

    Swift

    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool

    Parameters

    gestureRecognizer

    <#gestureRecognizer description#>

    touch

    <#touch description#>

    Return Value

    <#return value description#>

  • Undocumented

    Declaration

    Swift

    override func viewWillDisappear(_ animated: Bool)
  • Undocumented

    Declaration

    Swift

    override func viewDidLoad()
  • Undocumented

    Declaration

    Swift

    func setPagingViewFrame()
  • Undocumented

    Declaration

    Swift

    deinit
  • Undocumented

    Declaration

    Swift

    @objc
    func userBlockedHandler(notification: Notification)
  • Handler for changes of player state. rate (Play / pause) should be passed to chat controller (commentView) playbackBufferEmpty should show activity view. playbackLikelyToKeepUp, playbackBufferFull should hide activity view.

    Declaration

    Swift

    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)

    Parameters

    keyPath

    <#keyPath description#>

    object

    <#object description#>

    change

    <#change description#>

    context

    <#context description#>

  • Undocumented

    Declaration

    Swift

    override func viewWillAppear(_ animated: Bool)
  • Undocumented

    Declaration

    Swift

    override func viewDidAppear(_ animated: Bool)
  • this method is used to specify the viewcontroller is supporting the device orientation

    Declaration

    Swift

    func canRotate()
  • Undocumented

    Declaration

    Swift

    override func didReceiveMemoryWarning()
  • Undocumented

    Declaration

    Swift

    override func willRotate(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval)
  • Undocumented

    Declaration

    Swift

    override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation)
  • set the orientation to specified input

    Declaration

    Swift

    func setOrientation(to: UIInterfaceOrientation)

    Parameters

    to

    <#to description#>

  • responds to the orientation button tapped

    Declaration

    Swift

    @IBAction
    func orientationButtonTapped(_ sender: UIButton)

    Parameters

    sender

    <#sender description#>

  • show the loading screen till the time we get the latest status of the braodcast from the server

    Declaration

    Swift

    func showLoadingScreen()
  • Undocumented

    Declaration

    Swift

    func playVideo()
  • makes and api call to get all teh references and update the references on -1 screen

    Declaration

    Swift

    func getOrUpdateReferences()
  • Show processing screen to broadcaster when broadcast is in Work in progress state

    Declaration

    Swift

    func showProcessingViewWith(state: ProcessingScreenState)

    Parameters

    state

    state in which processing screens should be displayed (e.g live to recorded, deleted, broadcast is over)

  • Undocumented

    Declaration

    Swift

    func showScheduleOrProcessingViewWith(state: ScheduleOrProcessingScreenState)
  • Hides the processing screen shown

    Declaration

    Swift

    func hideProcessingScreen()
  • initialize and add +1 and -1 page

    Declaration

    Swift

    func setupView()
  • reloads the layout for the paging views

    Declaration

    Swift

    func reloadLayoutOfPagingViews()
  • adding the plus one screen to the paging

    Declaration

    Swift

    func addPlusOneViewToPageView()
  • Undocumented

    Declaration

    Swift

    func setPlusOneViewFrame()
  • adds the overlayview controller view to the paging view

    Declaration

    Swift

    func addOverlayViewToPageView()
  • Undocumented

    Declaration

    Swift

    func setOverlayViewFrame()
  • adds the clapsview controller view to the paging view

    Declaration

    Swift

    func addClapsViewToPageView()
  • Undocumented

    Declaration

    Swift

    func setClapsViewFrame()
  • adds the message view to the

    Declaration

    Swift

    func addMessageViewToPageView()
  • Undocumented

    Declaration

    Swift

    func setMessageViewFrame()
  • Scroll paging view to Page0 which has index of -1

    Declaration

    Swift

    @objc
    func scrollToPage0()
  • Implement scrolling horizontally with animation.

    Declaration

    Swift

    @objc
    func panGestureRecognizerHandler(panGesture: UIPanGestureRecognizer)

    Parameters

    panGesture

    <#panGesture description#>

  • Undocumented

    Declaration

    Swift

    func trackPageScroll(from fromIndex: CGFloat, to toIndex: CGFloat)
  • Undocumented

    Declaration

    Swift

    func trackEvent(eventName:EventName,eventProperty:[EventProperties: String]? = nil)
  • Undocumented

    Declaration

    Swift

    @objc
    func appEntersBackground()
  • Undocumented

    Declaration

    Swift

    @objc
    func appEntersForeground()