Python 3 Tkinter Script to Play MP4 Video Files in Video Player Using tkvideoplayer Library
206 views
Jun 3, 2025
Buy the full source code of application here:
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
So in this video I will show you a
0:04
Python package which allows you to play
0:06
videos inside your Twinter application
0:09
Twin is a framework by which you can
0:11
actually build out desktop applications
0:13
in Python So there is a package here
0:16
which allows you to play video files
0:18
inside your tinter application Uh if you
0:20
just this is actually the module here
0:23
The command is simple pip install TK
0:26
video player Now simply install this
0:29
package and uh if I run this application
0:32
now you will see the video will play in
0:34
the
0:35
window As you can see the video is
0:38
playing right
0:39
here So in this way you can play video
0:42
files inside your Twinter application
0:44
using this package So now to integrate
0:47
this it's very simple You first of all
0:50
require this
0:51
package First of all we require the
0:53
Twinter package
0:55
import Then we simply say here from
1:00
tokinter from
1:03
TK video player we need to
1:06
import tokinter video and then we
1:08
initialize the window by using
1:12
this and then we specify the actual
1:16
video So we
1:18
initialize the twin inter
1:21
video master is equal to root scaled is
1:24
equal to true and then we initialize
1:27
this uh video So wherever your path is
1:31
there
1:32
So I have this video here 1 mway m kv
1:38
write in the same directory Then we will
1:41
simply add this by using the pack
1:44
method Expand true fill
1:47
both And after that we will simply play
1:51
the video So for playing the video you
1:53
simply use the play button play function
1:57
Uh that's all that we need to do right
1:59
here and just need to start the main
2:01
application root dot main loop So this
2:04
is all the code which is required Now if
2:07
you launch your application you will see
2:09
the video will
2:11
play So as you can see here the video is
2:14
now playing right here In this way you
2:17
can play any sort of video inside
2:18
YouTube inter application using this
2:21
package It provides you with lot of the
2:24
utility kind of methods to play stop
2:26
pause everything you can do You can see
2:28
the video is playing So this is
2:31
essentially the package You can install
2:33
it and start using it And also check out
2:37
my website
2:38
freemediatools.com uh which contains
2:41
thousands of tools
#Multimedia Software
#Online Video
#Programming