Ways to play videos via python

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Change the size and position of everything without calculating anything!
  • First let me say that these examples are barely python, mostly winapi calls. They were mainly an exercise to see how it can be done.

    The first example is pretty much like the AVI object but without the controls. It's always drawn on top and it can be destroyed, but it has to be done manually.

    http://dl.dropbox.com/u/5426011/examples3/video.cap

    Made in 0.99.96

    Needs the ctypes python library.

    The second example is Media Player embedded in the window, so it supports any file format that Media Player can play.

    http://dl.dropbox.com/u/5426011/examples3/Movie.cap

    Made in 0.99.96

    Needs the ctypes and win32com python libraries.

    Python is cool, but I think a plug-in would be better.

    -cheers

    EDIT:

    Also if it's of any interest here's an example of embedding flash in your app:

    http://dl.dropbox.com/u/5426011/examples3/flash.cap

    Made in 0.99.96

    Needs the ctypes and win32com python libraries.

  • Cool example.. until we get a better plugin for video this is a nice alternative! I completely forgot about the Window object for this stuff...

  • Very cool! Thanks for sharing these :D

  • I can't seem to get the flash example working...

    I installed the required libraries but it just says some error about dispatch...

    <img src="http://prawnsushi.free.fr/bazar/pytflash.jpg">

    And then "name flash is not defined", though i specified a valid path/file ...

    I'm really interested by this example for my day job...

    Can you please help?

    Thanks

  • Do you have Flash installed for Internet Explorer? The error you're getting means that it can't find Flash installed.

    Here's the link from the Adobe site to install Flash for Internet Explorer:

    http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player_ax.exe

  • MMM it's true i never use IE lol i'll try to install the ie plugin.

    How come i didn't think about this? I even installed this plugin for a client (via logmein) ... this week !

    EDIT : great ! Works like a charm

    I can finally get rid of mediator 8 !

    Thank you

  • Wow nice job R0J0

    <img src="http://www.phuckpolitics.com/wp-content/uploads/2009/01/whos_awesome.jpg">

  • Hi,

    excuse me but I can't manage to have the ctypes library to work.

    I double click on the installer then a quick black screen appears and disappear in a second.

    Dunno if it works or no but Construct doesn't seem to find it.

    Is there something I do wrong ?

    I have Python 2.7.1 installed.

    Thanks !

    I can't wait to test this !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ctypes should be included with a python install and Construct uses python 2.6.

    Here are all the python files you need for ctypes, just extract into the "Construct\Data\Python" Directory.

    http://dl.dropbox.com/u/5426011/examples3/py.zip

  • Cool, it works now.

    Thanks a lot !

    I'm going to try this.

  • Hi!

    As my first post in this forum, a little word : construct is awesome, long live consctruct. I'm an old user of mmf2... since I switch to construct I can't go back, it's physiologically impossible <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Well, back to business : I'd like to ask if someone can provide a little handy .zip with the file I need to provide if I want to distribute... Let say that player I did to see where I can go with Rojo's way =)

    ConstructPlayer.zip

    I had to use the second way (the Media Player embedded I didn't manage to make the first one work, it was always a blank window), so I guess I have to provide all the ctypes libraries with its dependancies and all or part of the win32com stuff with dependancies too...

    I read the little py2exe quickguide by scidave but it seems a little blurry to me and as I'm nearing dangerously my deadline It would be great to have a little help with that thing =)

    little teaser of my game demo (for motivation purpose <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> ):

    http://www.cohl.fr/annuaire/images/0000000894_002.jpg

    (damn it's already a bit old...)

  • Here is all the needed files:

    http://dl.dropbox.com/u/5426011/examples5/py2.zip

    Extract this file to the same folder as your game.

    Then add this line before you import ctypes and win32com.

    sys.path=[System.AppPath + 'py2'][/code:mnr27tuh]
  • Thank you rojo =)

  • There seems to be a strange behavior when I try my player on another computer.

    All works fine on my eeepc which runs on windows XP (32bit)

    But when I run it on my home computer which runs on windows 7 (64bit) I get the following error :

    Traceback (most recent call last):
    File "<string>", line 4, in <module>
    File "C:\Documents and Settings\Big S\Local Settings\Temp\ConstructPlayer\py2\win32com\__init__.py", line5, in <module>
    ImportError: DLL load failed: The specified module could not be found[/code:2wt0jfy5]
    I was a bit surprised as I don't know any "Big S"  =)
    Then I tried to bring my own __init__.pyc (from my eeepc... I didn't install python on my home computer) ... there was the same kind of error but with my eeepc path.
    I infered that the path is compiled in the .pyc, I then tried with the corresponding .py 
    Then I get what it seems to be a dependancy error :
    [code:2wt0jfy5]Traceback (most recent call last):
    File "<string>", line 4, in <module>
    File "[PATH TO MY __init__.py]", line 5, in <module>
        import win32api, sys, os
    ImportError: DLL load failed: The specified module could not be found[/code:2wt0jfy5]
    I then checked the lib you gave me in the py2.zip , I saw  win32api.pyd, os.pyc, but no sys something.
    I tried to search the corresponding file in my python folder (back on my eeepc) but didn't find anything conclusive.
    
    As the computers at my school runs on windows 7, I think I need help... again.
  • Try the py2.zip download again, I updated it with some dlls it needed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)