Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Loading and playing a movie. Possible?
-
Is there any way to load a movie and be able to play parts of it?
I found nothing in the docs. -
The ui.WebView lets you display html content. If you can get a video into your pythonista folder, you can use a
<video>
html element to display it, or use video.js, etc. The tricky part is if you want to get a video from your ios photo stream, as opposed to, say, from the internet. Tony and techteej had a working solution, search the forums . The other tricky part is getting the url right. A WebView lets you load a url that is simply the abspath of the file, without any file://, etc. -
Thank you for your reply, Jon.
What I wanted was the ability to control the video, being able to click a button and advance a frame, for example. Or, being able to play/stop the video at the click of a button (not the standard system controls) -
Anything you can do with javascript and html5 can be done in a webview.
You may want to investigate some if the javascript video editors to see if they do what you want.
I haven't played around with them, but check out popcorn.js, and video.js plugins. There may be other things out there. I see videojs-framebyframe for example. There is also ffmpeg compiled I to javascript http://bgrins.github.io/videoconverter.js/, which you can expect to be extremely slow if it works at all. When I tried the demo, it crashed safari.I find javascript very frustrating to code in, and the python to javascript interface in webview is maddeningly difficult to debug.... But if you the patience for it, what you are after might be possible.
-
JonB, until I watched this video, I was intimidated by javascript. Not anymore however.
I am interested in a video player now myself (I use Editorial more than pythonista). If I make it, I will respond here.
-
I wouldn't say I'm intimidated by javascript.... I just find coding then testing in a browser to be especially tedious. Failures are often silent, especially when in a mobile browser. The heavy reliance on closures / anonymous functions makes things hard to debug. The lack of any sort of console, at least an easily accessible one on ios, makes any kind of debugging or testing difficult. Add to that the patchwork of browser compatibilities and extensions, and it is just not a pleasant experience, especially on mobile.
-
Main reason I am taking a whack at it is for Editorial. Easy testing also.
Debugging is an issue though, but I see it as a challenge. I'm starting with small but useful snippets right now.
Editorial needs more browser manipulation functions.
I wonder if I might be able to find code for a javascriot editor, and add it to Editorial.
Anyhow, as for the video player, I will be adding it to a Custom UI, but I can't find a way to package the video.
-
For a javscript editor within pythonista or editorial, check out
https://github.com/jsbain/EditAreaForPythonista
This has a primitive way to open, browse and save files, and the editor has syntax highlighting, etc. there are some keyboard quirks, and things like the search dialog have issues.
I nearly have a codemirror instance working, which I think will be a lot better than editarea.
But seriously, develop all you can off tablet, the lack of any real javascript debug capabilities is a killer.