thibauts / node-upnp-mediarenderer-client

An UPnP/DLNA MediaRenderer client
MIT License
128 stars 30 forks source link

TypeError: Cannot read property 'findtext' of null #27

Open KenADev opened 7 years ago

KenADev commented 7 years ago

Hey,

yesterday everything was working okay, but today i get this error when i try to send a video to one of my Samsung TVs: (Everything is working for my other two Samsung TVs, and i didn't change anything...)

C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:571
    var value = node.findtext('./' + field);
                    ^

TypeError: Cannot read property 'findtext' of null
    at C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:571:21
    at Array.forEach (native)
    at extractFields (C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:570:10)
    at parseDeviceDescription (C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:440:14)
    at C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:46:16
    at C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\upnp-device-client\index.js:559:7
    at ConcatStream.<anonymous> (C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\concat-stream\index.js:36:43)
    at emitNone (events.js:91:20)
    at ConcatStream.emit (events.js:185:7)
    at finishMaybe (C:\Users\***\Documents\nodejs-projects\samsung-dlna\node_modules\readable-stream\lib\_stream_writable.js:513:14)

The error is blocking furher execution.

I wonder what is going on there. It's neither working from my Windows PC nor my Raspberry Pi. Even though, I can send videos per upnp from Windows Media Player to this TV...

Can you give me a hint what is going on there in the code?

This is my code by the way:

var MediaRendererClient = require('upnp-mediarenderer-client');
var options = {
    autoplay: true, //play immediately
    contentType: 'video/x-ms-wmv',
    metadata: {
        title: 'Tuer klingelt',
        creator: 'Smarthome',
        type: 'video' //, // can be 'video', 'audio' or 'image'
    }
};

var client = new MediaRendererClient('http://192.168.178.26:7676/smp_11_');
client.load('http://*****/img/doorbell.wmv', options, function (err, result)
{
    console.log(result);
    if (err) throw err;
    console.log('VIDEO SUCCESSFULLY SENT TO TV!');
});
rzfzr commented 2 years ago

@KenADev Did you ever solve it?

KenADev commented 2 years ago

@KenADev Did you ever solve it?

I solved it somehow, but unfortunately, it's been over 5 years ago and I don't have the code anymore.