Get a video using GPRS and paly it

Description:

This example shows how to retrieve a .3gp video file using GPRS and then play it. The following modules are used:appuifw, e32, urllib.

###################################################
#Python examples for AAU Mobile Phone Programming #
#(c) Mobile Phone Group #
###################################################

import appuifw
import e32
import urllib

def get_video():
url = "http://kom.aau.dk/project/mobilephone/teaching/3GPPvideo/giampa.3gp"
tempfile = "c:\\Nokia\\Videos\\video01.3gp"
try:
print "Downloading video..."
urllib.urlretrieve(url, tempfile)
lock=e32.Ao_lock()
content_handler = appuifw.Content_handler(lock.signal)
content_handler.open(tempfile)
lock.wait()
print "Video viewing finished."
except IOError:
print "Could not access the file"
except:
print "Could not open the file"


def main_menu():
appuifw.app.menu = [(u"get video", get_video)]

lock = e32.Ao_lock()
appuifw.app.title = u"Get video"
main_menu()
lock.wait()

Download:

ex6.py

Output:

The following screenshots are the outcome. Just click on the icons to enlarge them for a better view.

Output

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)ies.aau.dk
Copyright © 2006 Department of Electronic Systems

Last update:02-10-2006