Book Image

Kivy Cookbook

By : Hugo Solis
Book Image

Kivy Cookbook

By: Hugo Solis

Overview of this book

Table of Contents (16 chapters)
Kivy Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Including multimedia for Windows


The GStreamer modules are not included by default in the previous recipe. In that sense, you could not load multimedia files in our app packaged for Windows. This is because the GStreamer is highly dependent on the operating system. To solve this, we must import the OS Python package. In this recipe, we are going to create a package of an app that can run a video.

Getting ready

We will use an app that has multimedia. This recipe is going to be similar to Working with video in Chapter 7, The API in Detail. In that recipe, we used just one Python file.

# e2.py
import kivy
kivy.require('1.9.0') # replace with your current kivy version !

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.videoplayer import VideoPlayer

class MyW(Widget):

    def __init__(self, **kwargs):
        super(MyW, self).__init__(**kwargs)
player = VideoPlayer(source='GOR.MOV', state='play', options={'allow_stretch': True}, size=(600,600))
        self.add_widget...