Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 132
Registered: ‎11-06-2012
My Device: BlackBerry Passport

Problem with ImageView and MediaPlayer in OS 10.1

My application is playing the video in machine, it works fine in OS10.0.10, but in 10.1 it can't load the thumbnail and video.

 

This is the snippet get the list video in my app, I've used the qDebug to print the result, it's ok. But in the media player, it doesn't work. Please help me to fix it. Thanks.

 

QVariantList ApplicationUI::loadListVideo() {
 QStringList nameFilter;
 QDir dir(QDir::currentPath() + "/data");

 nameFilter << "*.mp4";
 QFileInfoList list = dir.entryInfoList(nameFilter, QDir::Files);

 QVariantList outputList;
 for (int i = 0; i < list.count(); i++) {
  QVariantMap outputMap;
  if (!list[i].isDir()) {
   outputMap.insert("path", list[i].absoluteFilePath());
   outputMap.insert("title", list[i].fileName());

   QFile file(list[i].absoluteFilePath());
   fileSize = file.size();

   outputMap.insert("thumb", list[i].path() + "/" + list[i].completeBaseName() + ".jpg");
   outputList.append(outputMap);
  }
}