thibauts/node-upnp-mediarenderer-client

startAt parameter in .load()

jaruba opened this issue · 6 comments

I'm using node-upnp-mediarenderer-client in a player I'm currently working on (Powder Player, currently only a windows version).

As this is a feature that will be built in the player, some may choose to stream through DLNA after they've seen 30 minutes of a video. It is only normal that the TV should start playback at minute 30 where the user requested this action. Is it possible to add a startAt parameter to the options set for load()?

You can achieve that by calling load without autoplay, then seek and finally play. I'm not sure adding it as an option on load is wise for now.

Your project looks very interesting by the way ! I had something similar in mind for some time but no obvious solution for VLC integration. Looks like you used NPAPI / Pepper ? I'll check the source tomorrow, this looks very interesting to say the least !

I'm using the WebChimera Project for Powder Player, it is a different project that I've been working on with Sergey Radionov.

WebChimera Plugin is an NPAPI plugin that Sergey Radionov made, the plugin was made to give developers the possibility to create their own online User Interface for VLC.

On Mac and Linux, this plugin is natively windowless (so HTML can be set above the plugin window) but for Windows this is a problem as it uses a different rendering process, so FBVLC mode needs to be used to overlay HTML (but FBVLC Mode has big latency on playback).

The solution to all the HTML overlaying problems was introducing QT QML online sources, as QML is very advanced and can be used to create extremely complex and fast User Interfaces. In the time I've spent on the project I learned QML and created WebChimera Player, the first "ready-to-use", heavy duty player that uses WebChimera Plugin.

Since we've worked on this project for a very long time now we've helped a lot more developers then I could dream of with all their video requirements (for websites and with node.js apps). Many of the developers we've helped used WebChimera with Peerflix, as WebChimera Player is the only web player that supports srt, sub and webvtt subtitles and has many features that are not found in any other web player. There is no way to even count how many websites and apps use our project atm, but I am sure we've helped revolutionize this industry. :)

As you want to use this in a node.js/io.js app, probably with Node-Webkit (NW.js) or Atom/Electron. I recommend you also check out WebChimera.js (this is extremely new and very experimental). WebChimera.js is the newest addition to the WebChimera Project, it is made exclusively for Node-Webkit (NW.js) and Atom/Electron, it renders VLC's OpenGL output directly to the HTML Page on a canvas, it is fully windowless (natively supports overlaying HTML elements on all Operating Systems) and it is extremely efficient.

The new WebChimera.js project is currently maintained by @RSATom and @Ivshti , there is no User Interface for it yet but it could be ported to use any HTML5 Player UI by converting WebChimera Plugin's API to the HTML5 Video Tag's API. @Ivshti mentioned he will create a HTML shim for it soon, personally I will try to convert (as much as possible) WebChimera Player to HTML5 for it.

(sorry for the very long comment, but the project is very large and complicated to explain, thought you should know all the in's and out's as you had an interest in it)

You can achieve that by calling load without autoplay, then seek and finally play. I'm not sure adding it as an option on load is wise for now.

I didn't think of that, it makes sense, I've already implemented an auto-seek feature as described in the topic, the problem I'm having is that it's very slow, it can take up to 30 seconds for auto-seek to be triggered after the video starts playback.

The reason for this is that it's very hard to determine when the TV can accept a seek request, as from my tests it can't seek as soon as the .load() callback function is called. With autoplay active I'm listening for the PLAYING status in some cases, and for when it receives the total length in other cases.

It is very complicated to determine when the TV can accept a seek request as I'm working with all video types and also partial video files (not fully downloaded yet). .avi files have their own issues as if they are not fully downloaded no player can get the total time immediately and the time index is broken. From my tests, partial .avi files don't even send the initial PLAYING status in node-upnp-mediarenderer-client (that's why I'm listening for when it can calculate the total length in this case).

The reason I asked if a startAt is possible is because I was hoping that upnp/dlna supports such a parameter natively as a workaround for such a feature is, as described above, quite troublesome and laggy.

Your project looks very interesting by the way ! I had something similar in mind for some time but no obvious solution for VLC integration.

Thanks! It's great! I first made it as a proof of concept to attempt to help all the developers that wore using WebChimera with Peerflix tackle the issues that they wore having with it. Since then it grew into it's own project (with it's own customized version of WebChimera Player) and now many people are using it as a standalone solution for their torrent streaming and local player needs.

You are also more then welcome to join me in working on Powder Player if you are interested, I'm sure we can make it do everything you wanted your app to do and a lot more, a Mac version is not hard to make, it would only need a few days of compatibility fixes I just never got around to doing it yet. But you can of course go your own way if you want, we have a great support team at WebChimera eagerly awaiting to help you with anything you need on the player's side. :)

Unfortunately even if implemented in this module the startAt feature would suffer the same slowness...

If your still interested in a libvlc wrapper for node.js/io.js here are the project pages:
WebChimera.js
WebChimera.js Player

Awesome, thanks :)