2014-09-04 72 views
1

所以,我想將一個mp3文件放在一個數據庫blob中,並從那裏播放它。Titanium:來自數據庫的視頻播放器數據源

我可以看到視頻對象支持blob,但它看起來是一個文件blob?

var blobStream = Ti.Stream.createStream({ source: myBlob, mode: Ti.Stream.MODE_READ }); 
var newBuffer = Ti.createBuffer({ length: myBlob.length }); 
var bytes = blobStream.read(newBuffer); 

此外,它支持的文件或文本梅託德:

text : StringREADONLY 
UTF-8 string representation of the data in this blob. 
file : Titanium.Filesystem.FileREADONLY 
File object represented by this blob, or null if this blob is not associated with a file 

這是否意味着我可以指定BLOB作爲字符串?

+0

我認爲將mp3存儲在應用程序數據目錄並將其鏈接保存在數據庫中會更好,並使用該URL播放歌曲。 – Dragon 2014-09-05 03:59:34

回答