airplay

216 阅读1分钟
if (@available(iOS 11.0, *)) {
        AVRoutePickerView  *airPlayView = [[AVRoutePickerView alloc]initWithFrame:CGRectMake(0, 0, 35, 35)];
        //活跃状态颜色
        airPlayView.activeTintColor = [UIColor whiteColor];
        //设置代理
        airPlayView.delegate = self;
        [self.topView addSubview:airPlayView];
        self.airPlayView = airPlayView;
    } else {
        MPVolumeView  *airplay = [[MPVolumeView alloc] initWithFrame:CGRectMake(0, 0, 35, 35)];
        airplay.showsVolumeSlider = NO;
        airplay.backgroundColor = [UIColor whiteColor];
        [self.topView addSubview:airplay];
        self.airPlayView = airplay;
    }
    ```