omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Video

    Pythonista
    2
    15
    5383
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robertiii
      robertiii last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          also -- if you do the legwork and find an example of doing this in objc, it is usually pretty straightforward to convert to pythonista.

          1 Reply Last reply Reply Quote 0
          • robertiii
            robertiii last edited by

            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

            1 Reply Last reply Reply Quote 0
            • robertiii
              robertiii last edited by

              The goal is to have video play one place with controls another so the video would be similar to a background

              1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by

                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.

                1 Reply Last reply Reply Quote 1
                • robertiii
                  robertiii last edited by

                  Thanks so much! I'll try it when I get a chance! Let you know how it works out

                  1 Reply Last reply Reply Quote 0
                  • robertiii
                    robertiii last edited by

                    Video works great!!!!!! Any idea on how to get the name of the selected video?

                    1 Reply Last reply Reply Quote 0
                    • JonB
                      JonB last edited by

                      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() )
                      
                      1 Reply Last reply Reply Quote 0
                      • robertiii
                        robertiii last edited by

                        Thanks so much! You are incredible!

                        1 Reply Last reply Reply Quote 0
                        • robertiii
                          robertiii last edited by robertiii

                          How would I go about removing this avplayer later.

                          1 Reply Last reply Reply Quote 0
                          • robertiii
                            robertiii last edited by

                            Also, how would I use a button to go back to the beginning of the video?

                            1 Reply Last reply Reply Quote 0
                            • JonB
                              JonB last edited by

                              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.

                              1 Reply Last reply Reply Quote 0
                              • robertiii
                                robertiii last edited by

                                What cleanup would need to be done? I’m pretty much beginner coding.

                                1 Reply Last reply Reply Quote 0
                                • robertiii
                                  robertiii last edited by

                                  Also I’ve tried using the remove and have never been able to figure it out.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Powered by NodeBB Forums | Contributors