wTouch web interface - adding Pictures
#1
Hi, absolute beginner here. I'm trying to add Pictures to the wTouch web interface. I already got the directory listing, but when I click on the selected picture, I either get nothing or I get "Playback failed: One or more items failed to play" message. I use this code:

Code:
function browseDir(type,directory)
{
  addHistory(2,"Back",type,directory);
  var buf="";
  window.scrollTo(0, 1);
  jsonRequest('Files.GetDirectory', '"media": "'+type+'", "directory": "'+directory+'", "sort": { "method": "label", "order": "ascending" }',function(httpRequest)
  {
    var rsss=httpRequest.responseText;
    var jsonResult=JSON.parse(rsss)["result"];
    if (jsonResult)
    {
      var dirs=jsonResult["directories"];
      for (var idx in dirs)
      {
        var item= dirs[idx];
        buf+=createItem("browseDir('"+type+"','"+item["file"]+"')",item["label"],(item["thumbnail"])?'/thumb/'+item["thumbnail"]+".jpg":"DefaultFolder.png");
      }
      var files=jsonResult["files"];
      var haveMusics=false;
      for (var idx in files)
      {
        var item= files[idx];
        if (type=="music")
        {
          buf+=createItem("openFile('"+item["file"]+"')",item["label"],(item["thumbnail"])?'/thumb/'+item["thumbnail"]+".jpg":"DefaultAlbumCover.png");
          haveMusics=true;
        }
        if (type=="pictures")
        {
          var defImage=type=="pictures"?"DefaultVideo.png":"";
          buf+=createItem("openFile('"+item["file"]+"')",item["label"],(item["thumbnail"])?'/thumb/'+item["thumbnail"]+".jpg":defImage);
        }
        
        if (type=="video")
        {
          var defImage=type=="video"?"DefaultVideo.png":"";
          buf+=createItem("openFile('"+item["file"]+"')",item["label"],(item["thumbnail"])?'/thumb/'+item["thumbnail"]+".jpg":defImage);
        }
      }
      if (haveMusics)buf=createItem("shuffle('directory','"+directory+"')","Shuffle...","DefaultFolder.png")+buf;
      content.innerHTML="<ul>"+buf;
    }
  });
}

function openFile(file)
{
  play('file','"'+file+'"');
}

and the log is

Code:
10:23:03 T:4420 M:2234290176  NOTICE: DVDPlayer: Opening: smb://BLA%5cVasik:vasik@SERVER3/Filmy/fotky/Clip673.jpg
10:23:03 T:4420 M:2234290176 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
10:23:03 T:3712 M:2234290176  NOTICE: Creating InputStream
10:23:03 T:3712 M:2234290176  NOTICE: Creating Demuxer
10:23:03 T:3712 M:2234257408   ERROR: CDVDDemuxFFmpeg::Open - error probing input format, smb://BLA%5cVasik:vasik@SERVER3/Filmy/fotky/Clip673.jpg
10:23:03 T:3712 M:2234257408   ERROR: CDVDPlayer::OpenDemuxStream - Error creating demuxer
10:23:03 T:3712 M:2234257408  NOTICE: CDVDPlayer::OnExit()
10:23:03 T:3712 M:2234257408  NOTICE: CDVDPlayer::OnExit() deleting input stream
10:23:03 T:4420 M:2234286080   ERROR: Playlist Player: skipping unplayable item: 0, path [smb:///BLA%5cVasik:vasik@SERVER3/Filmy/fotky/Clip673.jpg]
10:23:03 T:4420 M:2234281984  NOTICE: CDVDPlayer::CloseFile()
10:23:03 T:4420 M:2234281984 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
10:23:03 T:4420 M:2234281984  NOTICE: DVDPlayer: waiting for threads to exit
10:23:03 T:4420 M:2234281984  NOTICE: DVDPlayer: finished waiting

Any idea how to fix this? Thanks
Reply
#2
Update:

I managed to start a slideshow with predefined directory, with this syntax inside wTouch script:

Code:
function openSlideshow(file)
{
  jsonRequest('XBMC.StartSlideshow', '"directory": "c:/fotky/"')
}

Now, the only thing I don't know is how to make the directory variable. I would like to click on a picture in a directory and start slideshow with photos in that directory. Could anyone who knows JS and JSON RPC help me how to get the directory path of the file I clicked on? Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
wTouch web interface - adding Pictures0