##// END OF EJS Templates
Change to encodestring to b64encode to avoid newlines in the data URI...
David Österberg -
Show More
@@ -138,7 +138,9 b' class Audio(DisplayObject):'
138 def src_attr(self):
138 def src_attr(self):
139 import base64
139 import base64
140 if self.embed and (self.data is not None):
140 if self.embed and (self.data is not None):
141 return """data:{type};base64,{base64}""".format(type=self.mimetype, base64=base64.encodestring(self.data))
141 data = base64=base64.b64encode(self.data).decode('ascii'))
142 return """data:{type};base64,{base64}""".format(type=self.mimetype,
143 base64=data)
142 elif self.url is not None:
144 elif self.url is not None:
143 return self.url
145 return self.url
144 else:
146 else:
General Comments 0
You need to be logged in to leave comments. Login now