生活随笔
收集整理的這篇文章主要介紹了
短视频网站源码干货分享:如何实现背景音乐和美颜功能
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
作為互聯網行業的后起之秀,短視頻沖破“包圍圈”深受大眾喜愛。隨著網民娛樂需求的不斷提高,對于視頻錄制的形式也提出了更高要求。短視頻網站源碼身為短視頻功能構成的基石,展現出了十分重要的作用。
以下提供短視頻中實現背景音樂功能相關的源代碼供大家參考:
#pragma mark - top10
-(void)pullTopTenMusic {NSString *url = [purl stringByAppendingFormat:@"?service=Music.hotLists&uid=%@",[Config getOwnID]];WeakSelf;[YBNetworking postWithUrl:url Dic:nil Suc:^(NSDictionary *data, NSString *code, NSString *msg) {[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];if ([code isEqual:@"0"]) {NSArray *infoA = [data valueForKey:@"info"];if (_paging == 1) {[self.allArray removeAllObjects];}if (infoA.count<=0) {[_tableView.mj_footer endRefreshingWithNoMoreData];}else {[self.allArray addObjectsFromArray:infoA];}if (self.allArray.count==0) {[PublicView showTextNoData:weakSelf.tableView text1:@"對不起~" text2:@"沒有搜索到相關內容"];}else{[PublicView hiddenTextNoData:weakSelf.tableView];}[self.tableView reloadData];}else{[PublicView showTextNoData:weakSelf.tableView text1:@"對不起~" text2:@"沒有搜索到相關內容"];[YBMsgPop showPop:msg];}} Fail:^(id fail) {[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];}];}
#pragma mark 收藏
-(void)pullCollectMusic {NSString *url = [purl stringByAppendingFormat:@"?service=Music.getCollectMusicLists&uid=%@&p=%d",[Config getOwnID],_paging];WeakSelf;[YBNetworking postWithUrl:url Dic:nil Suc:^(NSDictionary *data, NSString *code, NSString *msg) {[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];if ([code isEqual:@"0"]) {NSArray *infoA = [data valueForKey:@"info"];if (_paging == 1) {[self.allArray removeAllObjects];}if (infoA.count<=0) {[_tableView.mj_footer endRefreshingWithNoMoreData];}else {[self.allArray addObjectsFromArray:infoA];}if (self.allArray.count==0) {[PublicView showTextNoData:weakSelf.tableView text1:@"" text2:@"沒有收藏音樂"];}else{[PublicView hiddenTextNoData:weakSelf.tableView];}[self.tableView reloadData];}else{[PublicView showTextNoData:weakSelf.tableView text1:@"" text2:@"沒有收藏音樂"];[YBMsgPop showPop:msg];}} Fail:^(id fail) {[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];}];
}
#pragma mark - 搜索
-(void)pullSearchMusic {NSString *url = [purl stringByAppendingFormat:@"?service=Music.searchMusic&key=%@&p=%duid=%@",self.search.text,_paging,[Config getOwnID]];url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];WeakSelf;[YBNetworking postWithUrl:url Dic:nil Suc:^(NSDictionary *data, NSString *code, NSString *msg) {[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];if ([code isEqual:@"0"]) {//指示器消失[PublicView indictorHide];NSArray *infoA = [data valueForKey:@"info"];if (_paging == 1) {[self.allArray removeAllObjects];}if (infoA.count<=0) {[_tableView.mj_footer endRefreshingWithNoMoreData];}else {[self.allArray addObjectsFromArray:infoA];}if (self.allArray.count ==0) {[PublicView showTextNoData:weakSelf.tableView text1:@"對不起~" text2:@"沒有搜索到相關內容"];}else{[PublicView hiddenTextNoData:weakSelf.tableView];}[self.tableView reloadData];}else{[PublicView showTextNoData:weakSelf.tableView text1:@"對不起~" text2:@"沒有搜索到相關內容"];[YBMsgPop showPop:msg];//指示器消失[PublicView indictorHide];}} Fail:^(id fail) {//指示器消失[PublicView indictorHide];[_tableView.mj_header endRefreshing];[_tableView.mj_footer endRefreshing];}];
}
“愛美之心人皆有之”,短視頻選擇的受眾群體基本都屬于年輕群體,所以美顏功能成為必備功能。
@property(nonatomic, strong) UIView *beautyView; // 美顏窗口
@property(nonatomic, strong) UIView *faceTrimView; // 美型窗口
@property(nonatomic, strong) UIView *stickerView; // 貼紙窗口
@property(nonatomic, strong) UIView *filterView; // 濾鏡窗口
@property(nonatomic, strong) UIView *rockView; // Rock窗口
@property(nonatomic, strong) UIView *distortionView; // 哈哈鏡窗口@property(nonatomic, strong) UIView *greenScreenView; // 綠幕窗口
@property(nonatomic, strong) UISlider *faceTrimEyeMagnifyingSlider; // 美型-大眼拉條
@property(nonatomic, strong) UILabel *faceTrimEyeMagnifyingLabel; // 美型-大眼標簽
@property(nonatomic, strong) UISlider *faceTrimChinSlimmingSlider; // 美型-瘦臉拉條
@property(nonatomic, strong) UILabel *faceTrimChinSlimmingLabel; // 美型-瘦臉標簽
對于開發短視頻來說,短視頻網站源碼是必不可少的。以上為短視頻中背景音樂和美顏功能的部分源碼,本文僅供參考學習,轉載請注明出處,想要了解其他方面的源碼請閱讀其他文章。
總結
以上是生活随笔為你收集整理的短视频网站源码干货分享:如何实现背景音乐和美颜功能的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。