Merge pull request #749 from ANH25/editor-media-autoplay

Only autoplay added media when recording in editor
This commit is contained in:
Damien Elmes 2020-08-27 10:37:42 +10:00 committed by GitHub
commit 9aa3d7867e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -741,6 +741,7 @@ to a cloze type first, via 'Notes>Change Note Type'"""
)
return
if file:
av_player.play_file(file)
self.addMedia(file)
# Media downloads
@ -758,7 +759,6 @@ to a cloze type first, via 'Notes>Change Note Type'"""
name = urllib.parse.quote(fname.encode("utf8"))
return '<img src="%s">' % name
else:
av_player.play_file(fname)
return "[sound:%s]" % fname
def urlToFile(self, url: str) -> Optional[str]: