On Monday, February 5, 2018 at 11:22:30 AM UTC-6, Edward K. Ream wrote:

> 1. Every distribution option doubles the amount of testing required for a 
release. 

The following does indeed work when invoked in a python 3 interpreter, but 
maybe only on 64-bit systems:

import PyQt5.QtCore as C
import PyQt5.QtMultimedia as M
import os, sys
app=C.QCoreApplication(sys.argv)
path = 'c:/users/edreamleo/GayaneBalletSuite.mp3'
assert os.path.exists(path), repr(path)
url= C.QUrl.fromLocalFile(path)
content= M.QMediaContent(url)
player = M.QMediaPlayer()
player.setMedia(content)
player.play() 

The following works from within Leo:

import PyQt5.QtCore as C
import PyQt5.QtMultimedia as M
import os
path = 'c:/users/edreamleo/GayaneBalletSuite.mp3'
assert os.path.exists(path), repr(path)
url= C.QUrl.fromLocalFile(path)
content= M.QMediaContent(url)
player = M.QMediaPlayer()
player.setMedia(content)
g.app.permanentScriptDict['player'] = player # <--- new
player.play()

*Important*: a reference to the player must be retained, as shown in the 
penultimate line.

This is today's new idea, so maybe the new code *would *work on a 32-bit 
system.  But I don't want to test everything twice ;-)

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to