numen31337 / akvideoimageview Goto Github PK
View Code? Open in Web Editor NEWUIImageView subclass that allows you to display a looped video and dynamically switch it.
License: MIT License
UIImageView subclass that allows you to display a looped video and dynamically switch it.
License: MIT License
When leaving AKVideoImageView runnin & runnin, and worse with 2 or 3 differents AKVideoImageView looping on a video, the memory used is always increasing...
Your class is very cool.
Otherwise, it can be better if used by the integration directly in the storyboard (change UIImageView into AKVideoImageView).
To do so, it is necessary to test that the videoURL can be nul inside the playvideo method, then to add the ability to call playVideo on the setVideoURL method if the previous instance of videoURL was nil.
When I tried to use video via link then it is crashing
NSURL *videoURL = [NSURL URLWithString:@"http://www.webestools.com/page/media/videoTag/BigBuckBunny.mp4"];
AKVideoImageView *videoBG = [[AKVideoImageView alloc] initWithFrame:self.view.bounds
videoURL:videoURL];
Crash log
Thumbnail image generation error Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x600000240e70 {Error Domain=NSOSStatusErrorDomain Code=-1022 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-1022), NSLocalizedDescription=The operation could not be completed}
2017-08-09 11:57:15.747 Example[15354:280879] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVAssetReaderTrackOutput initWithTrack:outputSettings:] invalid parameter not satisfying: track != ((void *)0)'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105832b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000104f27141 objc_exception_throw + 48
2 AVFoundation 0x00000001054815ea -[AVAssetReaderTrackOutput dealloc] + 0
3 AVFoundation 0x000000010548118d +[AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:outputSettings:] + 62
4 Example 0x0000000104951ba5 -[AKVideoImageView createAssetReader] + 1045
5 Example 0x00000001049520a6 -[AKVideoImageView playVideo] + 870
6 Example 0x000000010495150b -[AKVideoImageView didMoveToSuperview] + 43
7 UIKit 0x000000010650fb53 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 932
8 UIKit 0x000000010650f72d -[UIView(Hierarchy) _postMovedFromSuperview:] + 828
9 UIKit 0x000000010651f6ba -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1927
10 UIKit 0x000000010650d9a8 -[UIView(Hierarchy) addSubview:] + 838
11 Example 0x0000000104950812 -[ViewController viewDidLoad] + 370
12 UIKit 0x0000000106602cca -[UIViewController loadViewIfRequired] + 1235
13 UIKit 0x000000010660310a -[UIViewController view] + 27
14 UIKit 0x00000001064cb63a -[UIWindow addRootViewControllerViewIfPossible] + 65
15 UIKit 0x00000001064cbd20 -[UIWindow _setHidden:forced:] + 294
16 UIKit 0x00000001064deb6e -[UIWindow makeKeyAndVisible] + 42
17 UIKit 0x000000010645831f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346
18 UIKit 0x000000010645e584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
19 UIKit 0x000000010645b793 -[UIApplication workspaceDidEndTransaction:] + 182
20 FrontBoardServices 0x000000010b0de5f6 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
21 FrontBoardServices 0x000000010b0de46d -[FBSSerialQueue _performNext] + 186
22 FrontBoardServices 0x000000010b0de7f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
23 CoreFoundation 0x00000001057d8c01 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
24 CoreFoundation 0x00000001057be0cf __CFRunLoopDoSources0 + 527
25 CoreFoundation 0x00000001057bd5ff __CFRunLoopRun + 911
26 CoreFoundation 0x00000001057bd016 CFRunLoopRunSpecific + 406
27 UIKit 0x000000010645a02f -[UIApplication _run] + 468
28 UIKit 0x00000001064600d4 UIApplicationMain + 159
29 Example 0x0000000104953acf main + 111
30 libdyld.dylib 0x0000000108f3165d start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
crash issue like below:
Thumbnail image generation error Error Domain=AVFoundationErrorDomain Code=-11839 "無法解碼" UserInfo={NSUnderlyingError=0x1356ce6a0 {Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)"}, NSLocalizedFailureReason=此媒體所需的解碼器忙碌中。, NSLocalizedRecoverySuggestion=停止其他解碼媒體的動作,然後再試一次。, NSLocalizedDescription=無法解碼}
Please give me some help thx
I'm having issues when trying to use this library with swift 3. First, complainig about NSURL (now named URL) and also, once removed the asserts for NSURL, I receive an error:
"[AVAssetReaderTrackOutput initWithTrack:outputSettings:] invalid parameter not satisfying: track != ((void *)0)"
help?
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.