Skip to content

Setup Control Layer View

changsanjiang edited this page Oct 20, 2019 · 1 revision

In this page

Adapters

The default edge control layer has top, left, bottom, right, center adapters, as follows:

You can add, remove, update items of any adapter.

Button Item Control

    static SJEdgeControlButtonItemTag const SJDemoButtonItemTag = 100;
   
    // Add item to top adapter
    {
        SJEdgeControlButtonItem *item = [[SJEdgeControlButtonItem alloc] initWithImage:[UIImage imageNamed:@"img_play"] target:self action:@selector(test) SJDemoButtonItemTag];
        [_player.defaultEdgeControlLayer.topAdapter addItem:item];
        [_player.defaultEdgeControlLayer.topAdapter reload];
    }
    
    // Remove
    {
        [_player.defaultEdgeControlLayer.topAdapter removeItemForTag:SJDemoButtonItemTag];
        [_player.defaultEdgeControlLayer.topAdapter reload]; 
    }

    // Update 
    {
        SJEdgeControlButtonItem *item = [_player.defaultEdgeControlLayer.topAdapter itemForTag:SJDemoButtonItemTag];
        // item.title = ...;
        // item.hidden = ...;
        item.image = ...;
        [_player.defaultEdgeControlLayer.topAdapter reload]; 
    }

Other Configuration

    SJEdgeControlLayer *controlLayer = self.player.defaultEdgeControlLayer;
    controlLayer.hiddenBackButtonWhenOrientationIsPortrait = YES;
    controlLayer.showResidentBackButton = YES;

    controlLayer.disabledPromptWhenNetworkStatusChanges = NO;
    controlLayer.showNetworkSpeedToLoadingView = YES; 

    controlLayer.hiddenBottomProgressIndicator = NO;
    controlLayer.bottomProgressIndicatorHeight = 3.0;
Clone this wiki locally