play RTSP stream dynamically

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
wanyangyang
New Cone
New Cone
Posts: 4
Joined: 24 Jul 2017 06:12

play RTSP stream dynamically

Postby wanyangyang » 24 Jul 2017 06:23

HTML CODE:

Code: Select all

<object type='application/x-vlc-plugin' id='vlc' events='True' width="720" height="540" pluginspage="http://www.videolan.org" codebase="http://downloads.videolan.org/pub/videolan/vlc-webplugins/2.0.6/npapi-vlc-2.0.6.tar.xz"> <param name='volume' value='50' /> <param name='autoplay' value='true' /> <param name='loop' value='false' /> <param name='fullscreen' value='true' /> </object>
JAVASCRIPT CODE:

Code: Select all

var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp"); var id = vlc.playlist.add(rtsp, "fancy name", options); vlc.playlist.playItem(id); //vlc.playlist.play(); //vlc.playlist.next(); //vlc.fullscreen();
I use IE11 and vlc 2.2.6, the code above didn't work. I dont know whether I used the wrong code or VLC2.2.6 has different APIs.
-----------------------------------------------------20170724 17:12--------------------------------------------------------------------------------------------
I've used win32 version of vlc
Last edited by wanyangyang on 24 Jul 2017 11:13, edited 1 time in total.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: play RTSP stream dynamically

Postby da2424 » 24 Jul 2017 09:00

Will it play, but without applied options?
Then, please try this:

Code: Select all

var options = ":aspect-ratio=4:3 --rtsp-tcp";
If it will not play, please check if you use the 32bits version of VLC.

wanyangyang
New Cone
New Cone
Posts: 4
Joined: 24 Jul 2017 06:12

Re: play RTSP stream dynamically

Postby wanyangyang » 24 Jul 2017 11:01

Will it play, but without applied options?
Then, please try this:

Code: Select all

var options = ":aspect-ratio=4:3 --rtsp-tcp";
If it will not play, please check if you use the 32bits version of VLC.
still doesn't work

wanyangyang
New Cone
New Cone
Posts: 4
Joined: 24 Jul 2017 06:12

Re: play RTSP stream dynamically

Postby wanyangyang » 24 Jul 2017 11:06

Will it play, but without applied options?
Then, please try this:

Code: Select all

var options = ":aspect-ratio=4:3 --rtsp-tcp";
If it will not play, please check if you use the 32bits version of VLC.
The

Code: Select all

vlc.playlist.add(rtsp);
method works, I can get an increasing Id from this method.

wanyangyang
New Cone
New Cone
Posts: 4
Joined: 24 Jul 2017 06:12

Re: play RTSP stream dynamically

Postby wanyangyang » 25 Jul 2017 04:57

It's solved. I used the wrong port in rtsp mrl. :(

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: play RTSP stream dynamically

Postby Jean-Baptiste Kempf » 28 Nov 2017 09:44

Easy fix then :D
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 1 guest