Jump to content
Sign in to follow this  
testingtest

Video Player

Recommended Posts

testingtest

this is for my usb its pretty case sensitive if you push pause and play real fast it will play the same song twice but over all its nice for a usb I use it at school a lot.

I lost the source but I think you guys will trust me I try to help

video_player.zip

Share this post


Link to post
Share on other sites
Sn0opy

ok, i tried it without looking at the source.

it's a very nice tiny tool what i was looking vor since a friend showed me his linux desktop. his video window looked like this. a very simple window, without any buttons etc.

do you used standard autoit commands or any udfs too?

//edit: ok, some ideas:

- add a screenshot function

- make it screenshot compatible. when i press the button and paste the screenshot into paint or irfan view the video will disappear, when i move the window

- (for videos only) just make 1 window. when i press play the "Video Player - XXX" window will disappear completly and when i press a key it will appear again

Edited by Sn0opy

Share this post


Link to post
Share on other sites
testingtest

ok, i tried it without looking at the source.

it's a very nice tiny tool what i was looking vor since a friend showed me his linux desktop. his video window looked like this. a very simple window, without any buttons etc.

do you used standard autoit commands or any udfs too?

//edit: ok, some ideas:

- add a screenshot function

- make it screenshot compatible. when i press the button and paste the screenshot into paint or irfan view the video will disappear, when i move the window

- (for videos only) just make 1 window. when i press play the "Video Player - XXX" window will disappear completly and when i press a key it will appear again

hmm you want to hide the video screen right never though of adding that but I will once I find the source and Ill post the new one

Share this post


Link to post
Share on other sites
Obi-w00t

You could have easily recovered the source, if you don't know how I can post it here for you. The program seems pretty good, except I can't get sound on some videos.

Share this post


Link to post
Share on other sites
testingtest

You could have easily recovered the source, if you don't know how I can post it here for you. The program seems pretty good, except I can't get sound on some videos.

you might not be able to get some videos working becuase of there format not sure

Share this post


Link to post
Share on other sites
NELyon

I can recover the source for you. Do you mind if i post it for you?

Share this post


Link to post
Share on other sites
Dhilip89

Nice example uses of Media Control Interface API.

There is the source code:

#include <GUIConstants.au3>

Opt("WinTitleMatchMode",2)
Opt("OnExitFunc","_exit")
Opt("GuiOnEventMode",1)
Global $mystatus = "Paused"
Global $pause = 0
Global $wintitle = "none"
$GUI = GUICreate("Video Player - Idle"  , 300, 26 , 0 , 0)
$Play = GUICtrlCreateButton("Play", 0, 0, 75, 25, 0)
$Pause = GUICtrlCreateButton("Pause", 75, 0, 75, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 150, 0, 75, 25, 0)
$Load = GUICtrlCreateButton("Load", 225, 0, 75, 25, 0)
GUICtrlSetOnEvent($Play , "_Play")
GUICtrlSetOnEvent($Pause , "_Pause")
GUICtrlSetOnEvent($Stop , "_Stop")
GUICtrlSetOnEvent($Load , "_Load")
GUISetOnEvent($GUI_EVENT_CLOSE , "_Exit")
GUISetState(@SW_SHOW)

While 1
Sleep(1000)
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"
WinSetTitle($GUI , "" , "Video Player - Playing")
EndFunc

Func _Stop()
mciSendString("Stop myvideo")
mciSendString("seek myvideo to start")
$mystatus = "STOPPED"
WinSetTitle($GUI , "" , "Video Player - Stopped")
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"
WinSetTitle($GUI , "" , "Video Player - Paused")
$pause = 1
Else
_Play()
EndIf
EndFunc
Edited by Dhilip

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

Share this post


Link to post
Share on other sites
Gif

Nice example uses of Media Control Interface API.

There is the source code:

#include <GUIConstants.au3>

Opt("WinTitleMatchMode",2)
Opt("OnExitFunc","_exit")
Opt("GuiOnEventMode",1)
Global $mystatus = "Paused"
Global $pause = 0
Global $wintitle = "none"
$GUI = GUICreate("Video Player - Idle"  , 300, 26 , 0 , 0)
$Play = GUICtrlCreateButton("Play", 0, 0, 75, 25, 0)
$Pause = GUICtrlCreateButton("Pause", 75, 0, 75, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 150, 0, 75, 25, 0)
$Load = GUICtrlCreateButton("Load", 225, 0, 75, 25, 0)
GUICtrlSetOnEvent($Play , "_Play")
GUICtrlSetOnEvent($Pause , "_Pause")
GUICtrlSetOnEvent($Stop , "_Stop")
GUICtrlSetOnEvent($Load , "_Load")
GUISetOnEvent($GUI_EVENT_CLOSE , "_Exit")
GUISetState(@SW_SHOW)

While 1
Sleep(1000)
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"
WinSetTitle($GUI , "" , "Video Player - Playing")
EndFunc

Func _Stop()
mciSendString("Stop myvideo")
mciSendString("seek myvideo to start")
$mystatus = "STOPPED"
WinSetTitle($GUI , "" , "Video Player - Stopped")
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"
WinSetTitle($GUI , "" , "Video Player - Paused")
$pause = 1
Else
_Play()
EndIf
EndFunc

Great job man awsome!!!!!

i think that i should include videos in my musci player eventhough i "forgot it" a bit, and messed up my scipt :)

small source but the video player indeed works perfect.

i think that the most advanced users should think about creating a program so usefull (a media player)

Edited by c4nm7

Share this post


Link to post
Share on other sites
Gif

Great job man awsome!!!!!

i think that i should include videos in my musci player eventhough i "forgot it" a bit, and messed up my scipt :)

small source but the video player indeed works perfect.

i think that the most advanced users should think about creating a program so usefull (a media player)

continue it, it's great, i mena fix some bugs add context menu, if possible fullscreen (definatly $WS_SIZEBOX+$WS_SYSMENU+$WS_MAXIMIZEBOX+$WS_MINIMIZEBOX)

and make it a bit easier to use....

great one and a really exceptional idea!!

Share this post


Link to post
Share on other sites
testingtest

I am thinking about a listview that is either binded to a hotkey or added in the gui to make a playlist

Share this post


Link to post
Share on other sites
testingtest

my teacher is being a pain so here will be a example of my next version still thinking and sort of busy

#include <Constants.au3>
#include <Sound.au3>
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)  
Global $File , $Pause , $String
TrayCreateItem("Play")
TrayItemSetOnEvent(-1 , "_Play")
TrayCreateItem("Stop")
TrayItemSetOnEvent(-1 , "_Stop")
TrayCreateItem("Pause")
TrayItemSetOnEvent(-1 , "_Pause")
TrayCreateItem("Select...")
TrayItemSetOnEvent(-1 , "_Load")
TrayCreateItem("Exit")
TrayItemSetOnEvent(-1 , "_Exit")
TraySetState()

While 1
    Sleep(10)   
WEnd
Edited by testingtest

Share this post


Link to post
Share on other sites
star2

nice job

I was in a need to make a video player and I'm still working on it so I'll finish it up after that I'll try urs


[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Share this post


Link to post
Share on other sites
lokster

The idea for video player made with autoit is good, but I don't think it's good idea to use MCI for this. Maybe dshow will be better.

Share this post


Link to post
Share on other sites
leecole

The idea for video player made with autoit is good, but I don't think it's good idea to use MCI for this. Maybe dshow will be better.

Works for mpg recordings, but no sound for Xvid (avi) recordings. All my video recording get encoded to Xvid.

Talking Clockhttp://www.autoitscript.com/forum/index.php?showtopic=20751Talking Headlineshttp://www.autoitscript.com/forum/index.php?showtopic=20655Sometimes, I sits and thinkssometimes, I just sits

Share this post


Link to post
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
Sign in to follow this  

×