April 24, 2024, 11:57:26 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Video Player

Started by GWS, December 10, 2013, 01:10:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

December 10, 2013, 01:10:24 PM Last Edit: December 12, 2013, 03:46:29 AM by GWS
Hi folks,

A while ago I did a program for showing images, which seemed to work well.
So I thought, why not do a similar thing for videos ..  :)

I've collected some nice ones from Youtube and such, like Andy Williams singing Autumn Leaves.
It's nice to be able to play them full screen ..

So here's my little program to show videos in a Window - or fullscreen.

In Window mode, you can pause the video by pressing the Spacebar, or turn the audio off by pressing the Enter key.  These are toggles ..

There's a context menu which pops up if you click the right mouse button.

It seems to work with most videos.  Sometimes though, you come across a video recorded in wide screen mode, where the video width exceeds the screen width - unfortunately I haven't found a way to make those play.

I've only tried it in 1024 x 768 screen resolution - whether it works at higher resolution, I don't know.
I'd be interested to know, since higher resolutions are beyond my eyesight ..  ::)

The .exe and source code are attached.

All the best, :)

Graham
Tomorrow may be too late ..

Doc

December 11, 2013, 06:59:45 PM #1 Last Edit: December 11, 2013, 07:49:42 PM by Doc
I'm definitely interested in testing it for ya... just have to find a couple of suitable wmv files first. :-)

Hope you are doing well, sir!

-Doc-

Update:
It seems to work well, Graham! Only problems I encountered (which I may look into myself) were the inability to re-size the window and also another issue that is a little bit difficult to describe. When I first open the app, it completely fills the entire desktop, including the task bar... in fact, the window itself is a little too large to fit my monitor and resolution setup. Here's the rub:

Not being able to tell whether the window was maximized or not, I immediately double clicked on the title bar to see if it would re-align to fit the screen (some apps do), but was surprised that it actually MOVED the entire window off the screen to the left side while also minimizing it to the taskbar. Once it goes to the taskbar, there is no way to get it back into the viewing area of the screen, so my only option is to shut the program down and restart it again.

I haven't taken the time to open the source code yet, so there may be a simple explanation and easy fix... may do that later.  ;D

I really like the concept and *think* there is an open-source DLL available somewhere that might be used to play additional formats. I'll try to figure out what I'm trying to remember in that regard.

Good stuff!

P.S. My screen resolution is set at 1600x900

LarryMc

My comments are exactly like Docs except my screen size is 1920x1080
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

December 12, 2013, 03:53:42 AM #3 Last Edit: December 12, 2013, 04:55:22 AM by GWS
Hi folks,

Hmm . that was a strange one. It was indeed intended to open fullscreen.  ::)

I found that it needed the window style to include the @maxbox as in ..

wstyle = @minbox|@maxbox


Otherwise, the showwindow w,@swmaximized statement - while opening apparently OK at full screen, gave the strange results you found. :o

The centerwindow w statement is also needed.

I'd never tried double clicking the caption bar, so I hadn't seen that effect before.  Very strange.

It also happens in IWBasic I've found.  Solution is the same, include the @maxbox and the centerwindow items.

Anyway, it seems OK now.  I've uploaded the new version.  Sorry about that, it's one of the joys of testing.

Best wishes, :)

Graham
Tomorrow may be too late ..

GWS

December 12, 2013, 06:25:36 AM #4 Last Edit: December 12, 2013, 06:27:09 AM by GWS
If anyone looks through the code, and wonders about the video Open statement ..


MCIString = "open " + chr$(34) + filename + chr$(34)+ " type MPEGVideo alias Vid "


I'm using the same MPEGVideo specification for ALL video files.

This is because of a comment I found on the web ..

Quote
The MpegVideo device type would be the Device Driver of choice for most of our multi-media needs since it will play a lot of the movie and music formats out there.

MpegVideo seems to look for any codec you have on your system which can play the file.

It certainly seems to work for all the video types I've been able to play, includiing some MP4 files if you have the appropriate Codecs installed.

If you get a message 'missing codec' in Windows Media Player, you might like to try the file K-Lite Codec Pack, available from ..

http://www.filehippo.com/download_klite_codec_pack/

You may wish to untick some of the tools options offered though, and opt to keep your player default set to Windows Media Player if you prefer that one.  (Thanks to Egil for the link)

There seems to be little co-ordination of all the video file types in use. A bit of standardisation would be nice. :)

Graham :)

Tomorrow may be too late ..