VLC network stream

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
ittzy
Posts: 27
Joined: Thu Feb 04, 2016 11:48 pm

VLC network stream

Post by ittzy » Sun Feb 17, 2019 6:54 pm

Hi im trying to make a multiviewer on network urls, like when you look at a stream on vlc.

I need some one to explaine how i load a url to the player? I want to be able to write the url and then click a button play to start.

Klaus
Posts: 10971
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: VLC network stream

Post by Klaus » Sun Feb 17, 2019 7:12 pm

Hi ittzy,

just set the FILENAME of your player to the url. :D

Best

Klaus

ittzy
Posts: 27
Joined: Thu Feb 04, 2016 11:48 pm

Re: VLC network stream

Post by ittzy » Mon Feb 18, 2019 1:34 am

Thx Klaus but i dont realy understand.

I have a player, text box and a button

In the text I need to write: Tcp:\\212.247.219.90:5019 to access my live feed. And when I press play button I want it to start in the player.


How do I program that

bogs
Posts: 3359
Joined: Sat Feb 25, 2017 10:45 pm

Re: VLC network stream

Post by bogs » Mon Feb 18, 2019 10:01 am

Hi ittzy,
if you look in the dictionary under filename, one of the examples is a url for a web address.

Code: Select all

set the filename of last player to "http://www.example.com/myMovie.mov"
It shouldn't make any difference if you are using an octet address or really any other address, the format would be the same.
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1988
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: VLC network stream

Post by [-hh] » Mon Feb 18, 2019 4:03 pm

The player control isn't the appropriate control for streaming. But you can use browser widgets.
As follows is a minimal setup with an audio-example. It's similar for video.

Code: Select all

on mouseUp
  put "browser1" into bb
  if there is no widget bb then create widget bb as "com.livecode.widget.browser"
  set rect of widget bb to (20,20,320,160) -- need height for the volume slider
   -- loads the swiss radio jazz channel:
  set the htmltext of widget bb to html()
end mouseUp

function html
  -- you need the margin-top for the volume slider
  return "<html><head></head><body><div style='margin-top:100'>" & \
        "<audio id='p1' controls>" & \
        "<source src='http://www.radioswissjazz.ch/live/aacp.m3u'></audio>" & \
        "<script>var p1=document.getElementById('p1'); p1.volume=0.1;</script>" & \
        "</div></body></html>"
end html
You can then make buttons to play/pause etc.

Code: Select all

-- button play
on mouseUp
  do "p1.play()" in widget "browser1"
end mouseUp

-- button pause
on mouseUp
  do "p1.pause()" in widget "browser1"
end mouseUp
shiftLock happens

bogs
Posts: 3359
Joined: Sat Feb 25, 2017 10:45 pm

Re: VLC network stream

Post by bogs » Mon Feb 18, 2019 4:26 pm

Pretty slick -hh, nice example.
Image

ittzy
Posts: 27
Joined: Thu Feb 04, 2016 11:48 pm

Re: VLC network stream

Post by ittzy » Tue Feb 19, 2019 1:18 am

Thanks will try that :)

ittzy
Posts: 27
Joined: Thu Feb 04, 2016 11:48 pm

Re: VLC network stream

Post by ittzy » Sat Feb 23, 2019 2:56 pm

yeah that works i get the jazz, but the thing is that i want to play is not a webpage?

it´s tcp://212.247.216.93:5015 and i want it to load from this field. Im sorry if there is a lot of noobie questions, but im sooo bad at this.
Attachments
Skärmavbild 2019-02-23 kl. 14.52.27.png

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1988
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: VLC network stream

Post by [-hh] » Sat Feb 23, 2019 6:39 pm

Yes, the browser widget can only use http(s)-Addresses. So what works in your browser (Chrome, Safari, Firefox) will usually work in the widget. But there is currently no interface of browsers for raw tcp sockets like yours.
LiveCode has also a tcp-interface with "sockets" (see Dictionary). So what works in VLC (menu file > open network... ) has a chance to work with the socket lib, which requires advanced networking knowledge to use.

You could try to get a http-stream-address from your stream provider.
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3238
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: VLC network stream

Post by richmond62 » Sat Feb 23, 2019 7:29 pm

Try this:

https://www.facebook.com/21629974106846 ... 323312917/

And, if it works, all you have to do is set up
some locked Facebook page (i.e. with NO access to anyone except yourself)
and upload your video there.

Some of my teenage pupils inform me there are locked Facebook pages that contain
links like my one above, BUT to "p*rn" streams! So . . . what's stopping you? :D

https://use-livecode.runrev.narkive.com ... on-desktop

Post Reply

Return to “Internet”