Jump to content

Video player


zeroZshadow
 Share

Recommended Posts

i hope you don't mind for presenting you my newest pride.......

My VideoPlayer

this is gonna be connected to the ZeroPlayer later (see media player)

here is the code, messy, but its there.

its not ver good yet, but i made it in a hour or so

#include <GuiConstants.au3>
Opt("WinTitleMatchMode",2)
Opt("OnExitFunc","_exit")
Opt("GuiOnEventMode",1)
Global $mystatus = "Paused"
Global $pause = 0
Global $wintitle = "none"
$GUI = GuiCreate("VideoPlayer",400,35,350,300,-1)
$PLAY = GUICtrlCreateButton("Play",41,2,40,30)
$PAUSEBUT = GUICtrlCreateButton("Pause",82,2,40,30)
$STOP = GUICtrlCreateButton("Stop",123,2,40,30)
$LOAD = GUICtrlCreateButton("Load",164,2,40,30)
$STATUS = GUICtrlCreateLabel("Status: "&$mystatus&@CRLF,206,0,-1,30)
GuiSetState()
GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit")
GUISetOnEvent($GUI_EVENT_MINIMIZE,"_Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE,"_Restore")
GuiCtrlSetOnEvent($PLAY,"_Play")
GuiCtrlSetOnEvent($STOP,"_Stop")
GuiCtrlSetOnEvent($LOAD,"_Load")
GuiCtrlSetOnEvent($PAUSEBUT,"_Pause")

HotKeySet("^{DEL}","_Exit")
While 1
    $stateplayer = WinGetState("VideoPlayer", "")
    if BitAnd($stateplayer ,8) Then
        $statemovie = WinGetState("VideoMovie", "")
        If BitAnd($statemovie, 16) Then
        WinSetState("VideoMovie","",@SW_RESTORE)
        EndIf
    EndIf
    sleep(50)
Wend

Func mciSendString($string)
   Local $ret
   $ret = DllCall("winmm.dll","int","mciSendString","str",$string,"str","","int",65534,"hwnd",0)
   If Not @error Then Return $ret[2]
EndFunc
Func _Exit()
    mciSendString("Close myvideo")
    Exit
EndFunc

Func _Play()
    $pause = 0
    mciSendString("play myvideo repeat")
    $mystatus = "PLAYING"
    Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
    WinSetTitle($wintitle,"","VideoMovie")
EndFunc
Func _Stop()
    mciSendString("Stop myvideo")
    mciSendString("seek myvideo to start")
    $mystatus = "STOPPED"
    Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
EndFunc
Func _Load()
    mciSendString("Close myvideo")
    $file = FileOpenDialog("OPEN","","Video (*.avi;*.mpg)")
    $wintitle = stringsplit($file,"\")
    $wintitle = $wintitle[$wintitle[0]]
    $file = '"'&$file&'"'
    mciSendString("open "&$file&" alias myvideo")
    _Play()
EndFunc
Func _Pause()
    If $pause = 0 Then
        mciSendString("stop myvideo")
        $mystatus = "PAUSED"
        Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
        $pause = 1
    Else
        _Play()
    EndIf
EndFunc

Func _Minimize()
    WinSetState("VideoMovie","",@SW_MINIMIZE)
EndFunc
Func _Restore()
    WinSetState("VideoMovie","",@SW_RESTORE)
EndFunc

hope you like it.

pleas pm or POST any error.

idea's are welkom, but remeber ITS SUPPOSED TO BE SIMPLE, don't ask for skins.

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

tried playing an Mpg

had C++ runtime error

when in debug this is what came up:

Unhandled exception at 0x016d2ac4 in AutoIt3.exe: 0xC0000005: Access violation reading location 0x0170fffa.

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

i hope you don't mind for presenting you my newest pride.......

My VideoPlayer

this is gonna be connected to the ZeroPlayer later (see media player)

here is the code, messy, but its there.

its not ver good yet, but i made it in a hour or so

Hello zeroZshadow your script is greát he works wis no bugs for me,but i habe adde on your code the mp3 load func to play it^^ :lmao:

Thx you very nice tool :)

Great job dudu o:)

; Script Start - Add your code below here

#include <GuiConstants.au3>
Opt("WinTitleMatchMode",2)
Opt("OnExitFunc","_exit")
Opt("GuiOnEventMode",1)
Global $mystatus = "Paused"
Global $pause = 0
Global $wintitle = "none"
$GUI = GuiCreate("VideoPlayer",400,35,350,300,-1)
$PLAY = GUICtrlCreateButton("Play",41,2,40,30)
$PAUSEBUT = GUICtrlCreateButton("Pause",82,2,40,30)
$STOP = GUICtrlCreateButton("Stop",123,2,40,30)
$LOAD = GUICtrlCreateButton("Load",164,2,40,30)
$STATUS = GUICtrlCreateLabel("Status: "&$mystatus&@CRLF,206,0,-1,30)
GuiSetState()
GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit")
GUISetOnEvent($GUI_EVENT_MINIMIZE,"_Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE,"_Restore")
GuiCtrlSetOnEvent($PLAY,"_Play")
GuiCtrlSetOnEvent($STOP,"_Stop")
GuiCtrlSetOnEvent($LOAD,"_Load")
GuiCtrlSetOnEvent($PAUSEBUT,"_Pause")

HotKeySet("^{DEL}","_Exit")
While 1
    $stateplayer = WinGetState("VideoPlayer", "")
    if BitAnd($stateplayer ,8) Then
        $statemovie = WinGetState("VideoMovie", "")
        If BitAnd($statemovie, 16) Then
        WinSetState("VideoMovie","",@SW_RESTORE)
        EndIf
    EndIf
    sleep(50)
Wend

Func mciSendString($string)
   Local $ret
   $ret = DllCall("winmm.dll","int","mciSendString","str",$string,"str","","int",65534,"hwnd",0)
   If Not @error Then Return $ret[2]
EndFunc
Func _Exit()
    mciSendString("Close myvideo")
    Exit
EndFunc

Func _Play()
    $pause = 0
    mciSendString("play myvideo repeat")
    $mystatus = "PLAYING"
    Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
    WinSetTitle($wintitle,"","VideoMovie")
EndFunc
Func _Stop()
    mciSendString("Stop myvideo")
    mciSendString("seek myvideo to start")
    $mystatus = "STOPPED"
    Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
EndFunc
Func _Load()
    mciSendString("Close myvideo")
    $file = FileOpenDialog("OPEN","","Video (*.mp3;*.avi;*.mpg)")
    $wintitle = stringsplit($file,"\")
    $wintitle = $wintitle[$wintitle[0]]
    $file = '"'&$file&'"'
    mciSendString("open "&$file&" alias myvideo")
    _Play()
EndFunc
Func _Pause()
    If $pause = 0 Then
        mciSendString("stop myvideo")
        $mystatus = "PAUSED"
        Guictrlsetdata($STATUS,"Status: "&$mystatus&@CRLF)
        $pause = 1
    Else
        _Play()
    EndIf
EndFunc

Func _Minimize()
    WinSetState("VideoMovie","",@SW_MINIMIZE)
EndFunc
Func _Restore()
    WinSetState("VideoMovie","",@SW_RESTORE)
EndFunc
Edited by DirtyBanditos
Link to comment
Share on other sites

:lmao: you didn't post the version with my code so the windows follow each other

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

UPDATE!!!!

the video player now has allot of BUGS KILLED.

dunno if its bug free so pm or mail when u find one.

it even has a style now.

i will include it in my zeroplayer installer that u can find here:

i hope you like it

the video and others ARE decompile able, so you can add file file types to play.

it can play all video types if you have the codecs (if i'm correct :lmao:)

i would love to hear ur response.

Edited by zeroZshadow
*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

Well they are working for me but Zeroplayer set itself as the default player of .mp3's even tho I had that option unchecked on install. (It only happened after I played a .mp3). Also i get this error when using Undo.exe:

Line 0  (File "C:\Documents and Settings\Chris\My Documents\programming\autoit\projects\installer\Undo.exe"):

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\wmafile\shell\play\command","","REG_SZ",""C:\Program Files\Windows Media Player\wmplayer.exe" /prefetch:5 /Play" "%L")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\wmafile\shell\play\command","","REG_SZ",""C^ ERROR

Error: Unable to parse line.

Other then that, they work pretty good :lmao:

Edited by steveR
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Link to comment
Share on other sites

i'm checking it RIGHT NOW

the error was that it took a "" before writing, so he thought it was a variable or something, so "ERROR"

thanks for noticing

EDIT:

i fixed the checkbox, but the problem is that I CAN't make the undo.exe, because of a problem with the ' and " i need more of those kinds.

if i can do that (hint help hint) then i'll put that in again, untill then i'll make an txt file that says how you can fix it.

EDIT2: I replaced the installer.zip with the new one. IT DOES work :lmao:

the checkbox is fixed and tested, the undo file removed, helpfile made howto undo the regedit.

have fun o:)

Edited by zeroZshadow
*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

  • 2 weeks later...

oke...........i'm kinda dead of ideas here....

does NOBODY has bugs???

does NOBODY has improvements ideas??

i just like to work on my mediaplayer and video player, but maby somebody know another thing that needs to be build. (don't ask notepad/calcutor, i made those already)

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

put them in one GUI and make it so the images for the video player light up when you move your mouse over them

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

As far as i tryed i CAN'T pu them in one GUI, because i can't have the mci window fuse with mine :)

the lightingup idea is good, but this will mean the program takes up more space

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

not that much more space, what format are you using

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

use JPEG, waaaaaaaay smaller. just make sure you do it right so you don't get that smeared look

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

oke...........i'm kinda dead of ideas here....

does NOBODY has bugs???

does NOBODY has improvements ideas??

i just like to work on my mediaplayer and video player, but maby somebody know another thing that needs to be build. (don't ask notepad/calcutor, i made those already)

<{POST_SNAPBACK}>

Ok, here are some simple bugs. I ran the script and what I noticed is that the Status shows Paused, instead of Stopped. Also, I went to LOAD, but did not have a .MPG files to play at the moment and the Status showed Playing. Yes, it maybe nitpicky but the Status should show the true action not what is expected based on pressing a button.

But, I like the whole concept of what you created.. :)

Link to comment
Share on other sites

  • 1 year later...

how do I do full screen and controls in the same window

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...