抖音app开发时,在录制视频添加背景音乐功能实现流程

本文介绍了抖音App开发中如何实现录制视频时添加背景音乐的功能。主要涉及点击音乐绘制UI、音乐分类界面、音乐列表、音乐试听下载及编辑音乐的路径设置等步骤。该功能虽小,但技术实现过程复杂,对于感兴趣的读者,作者承诺会后续更新相关内容。
摘要由CSDN通过智能技术生成

抖音app之所以“横扫”整个短视频领域,最主要的还是占据了短视频玩法的“先机”,其中在录制视频时添加背景音乐,是很多用户都非常喜欢的步骤,但是在抖音app开发时,添加背景音乐的功能也是需要技术实现的。今天就来分享下关于这一功能的大概实现流程。
1.在录制界面点击音乐,绘制UI

添加搜索框
-(UIView *)searchBg {
    if (!_searchBg) {
        _searchBg = [[UIView alloc]initWithFrame:CGRectMake(0,64+statusbarHeight,_window_width,44)];
        _searchBg.backgroundColor = [UIColor whiteColor];
        
        _search = [[UISearchBar alloc]initWithFrame:CGRectMake(0,0, _window_width,44)];
        _search.backgroundImage = [PublicObj getImgWithColor:[UIColor whiteColor]];
        _search.placeholder = @"搜索歌曲名称";
        _search.delegate = self;
        UITextField *textField ;
        if (@available(iOS 13.0,*)) {
            textField = _search.searchTextField;
        }else {
           textField = [_search valueForKey:@"_searchField"];
        }
        [textField setBackgroundColor:RGB_COLOR(@"#f9fafb", 1)];
//        [textField setValue:GrayText forKeyPath:@"_placeholderLabel.textColor"];
//        [textField setValue:[UIFont systemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
        UIButton *clearBtn = [textField valueForKey:@"_clearButton"];
        [clearBtn addTarget:self action:@selector(clickClearBtn) forControlEvents:UIControlEventTouchUpInside];
        textField.textColor = GrayText;
        textField.layer.cornerRadius = 18;
        textField.layer.masksToBounds = YES;
        [_searchBg addSubview:_search];
    }
    return _searchBg;
}

2.添加音乐分类界面

 - (MusicH
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值