mgxu / fmgavplayer Goto Github PK
View Code? Open in Web Editor NEW自定义视频播放器,支持横竖屏,支持播放器显示位置,想显示在哪里就在哪里!!!
License: GNU General Public License v2.0
自定义视频播放器,支持横竖屏,支持播放器显示位置,想显示在哪里就在哪里!!!
License: GNU General Public License v2.0
我放到一个视图里面,我返回到上级,时就崩了
urlString 能够是本地文件路径吗
(void)playButtonAction:(UIButton *)sender{
_fmVideoPlayer.index = sender.tag - 100;
FriendInfoResultModel * tempResultModel = [FriendInfoResultModel mj_objectWithKeyValues:self.dataArr[_fmVideoPlayer.index]];
VideosModel * model = [VideosModel mj_objectWithKeyValues:[tempResultModel.videos firstObject]];
[_fmVideoPlayer setUrlString:model.path];
//_fmVideoPlayer.frame = CGRectMake(0, 275*(sender.tag - 100) + kScreenWidth/5 + 50 , kScreenWidth, (self.view.frame.size.width-20)/2);
MovieTableViewCell * cell = [self.mainTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:_fmVideoPlayer.index]];
CGRect cellRect = [cell convertRect:cell.videoPlayer.frame toView:self.view.window];
_fmVideoPlayer.frame = cellRect;
[self.view addSubview:_fmVideoPlayer];
_fmVideoPlayer.contrainerViewController = self;
[_fmVideoPlayer.player play];
[_fmVideoPlayer showToolView:YES];
_fmVideoPlayer.playOrPauseBtn.selected = YES;
_fmVideoPlayer.danmakuView.hidden = YES;
_fmVideoPlayer.hidden = NO;
}
这样添加后,视频View一直在固定位置。
哦,原来必须是UITableViewController
我的首页是视频列表 push进去后是视频播放页,播放对应的视频,
但是从视频播放页退出后,该页面的dealloc方法不走,
你的playerView那个类的dealloc方法也不走.
另外你里面有个键值观察,销毁时没有移除观察者,
我考虑到是我的使用方法有误,于是下载你的demo,包上导航栏控制器,push到下页播放,还是存在这个问题
真机上内存增长不是很明显,模拟器上特别明显,反复进入 退出,就能涨到几百兆(也可能是模拟器的问题)
真机切换到横屏就没有画面了,模拟器一切正常,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.