I am desperately trying to get a video from the camera roll and play it. I don't know how to use objc_util well enough though I've coded in xcode. Any help?
Forum Archive
Video
can you ou be a little more specific on your end goal? are you trying to integrate into a uiview? or just want to preview a video?
for instance, i have code in my objc_hacks repo that plays a video frame by frame, but no audio, etc.
There has been forum code that saves an asset to a local mp4 or mov, then you can play that in a webview, or in the quicklook.
also -- if you do the legwork and find an example of doing this in objc, it is usually pretty straightforward to convert to pythonista.
Ok. So I want to present a video in a UI view. I'll look around to see what I can find. This part I am pretty clueless on
The goal is to have video play one place with controls another so the video would be similar to a background
https://gist.github.com/3e708b73a04e5fc2e04569d9556198e3
Okay, this was not too bad. There is a lot of code defining CMTime and seeking ability, which is not needed if you just want to play without seeking.
Thanks so much! I'll try it when I get a chance! Let you know how it works out
Video works great!!!!!! Any idea on how to get the name of the selected video?
the phasset (in pick_asset) has a filename() method that returns the filename. You might want to modify that method as
return asseturl, str(phasset.filename() )
Thanks so much! You are incredible!
How would I go about removing this avplayer later.
Also, how would I use a button to go back to the beginning of the video?
You can just remove_subview on the wrapper view to remove it. Technically maybe if you are planning on opening and closing a bunch of these, there is probably some cleanup that is required.
To seek. just use the seek function, and wrap a button action around it, similar to the way the slider action did.
What cleanup would need to be done? I’m pretty much beginner coding.
Also I’ve tried using the remove and have never been able to figure it out.