1
00:00:00,330 --> 00:00:01,740
So welcome back to the course.

2
00:00:02,190 --> 00:00:09,300
So we're going to take a look at our fifth video, which is auto connect function or class that we've

3
00:00:09,510 --> 00:00:13,520
I use frequently when loading are our TSB streams.

4
00:00:13,530 --> 00:00:18,870
So let's take a look at this because it's quite useful because there's this close off the windows of

5
00:00:18,870 --> 00:00:22,620
real intimacy and zoom in here.

6
00:00:22,800 --> 00:00:30,220
So you can see there's this entire class here that creates basically it's a video capture class, and

7
00:00:30,220 --> 00:00:32,550
it's I wouldn't go into the details of this function.

8
00:00:32,970 --> 00:00:40,050
However, what it does, it basically is a function that monitors a video stream or TSP stream or any

9
00:00:40,050 --> 00:00:41,850
types of stream actually coming to it.

10
00:00:42,360 --> 00:00:49,980
And basically, if the feed goes down, it auto reconnects to it so you can see we we create a class

11
00:00:49,980 --> 00:00:54,710
called video capture here, and we set up using the open sea view video capture function.

12
00:00:54,720 --> 00:01:01,170
We've created own video capture function here with the output stream here and inside of this object

13
00:01:01,170 --> 00:01:01,530
function.

14
00:01:01,530 --> 00:01:06,090
It does the internal checking here to ensure that its feed is always connected.

15
00:01:06,090 --> 00:01:12,660
It has a connect function, so whenever it detects that the feed goes down here, it'll try to reconnect

16
00:01:12,750 --> 00:01:14,520
using that connect function.

17
00:01:14,880 --> 00:01:19,290
So it's a very good, low class that's created here.

18
00:01:19,860 --> 00:01:21,660
So let's just test it out.

19
00:01:21,660 --> 00:01:23,110
Oops, we didn't declare this.

20
00:01:24,210 --> 00:01:28,410
So what I'm going to do, I'm going to test it out by bringing down my internet connection.

21
00:01:28,410 --> 00:01:31,950
I'm going to disconnect my Wi-Fi so he can see it work in action.

22
00:01:32,490 --> 00:01:34,800
So it's connecting here and it's connected.

23
00:01:34,800 --> 00:01:40,200
Now you can see this display, Nat, and the image is being played here since the previous streams,

24
00:01:40,500 --> 00:01:42,360
but it of us who wouldn't get confused.

25
00:01:43,080 --> 00:01:48,510
So now that's disconnect the internet and you can see the stream has stopped.

26
00:01:48,630 --> 00:01:49,840
Now let's reconnect.

27
00:01:49,860 --> 00:02:00,380
Although if I connect back to my building's internet and hopefully it will reconnect shortly, there

28
00:02:00,600 --> 00:02:00,990
it goes.

29
00:02:01,440 --> 00:02:02,160
So you can see it.

30
00:02:02,160 --> 00:02:03,900
Auto reconnected to that video stream.

31
00:02:04,320 --> 00:02:08,430
So this is an invaluable algorithm of function.

32
00:02:08,430 --> 00:02:14,460
Feel whatever you want to call it, a valuable piece of code that allows us to maintain connections

33
00:02:14,460 --> 00:02:15,630
to our video players.

34
00:02:15,960 --> 00:02:22,560
It doesn't crash because I previously built an application web, and I naively thought this was like

35
00:02:22,560 --> 00:02:29,160
three or four years ago where I naively thought that the RTP stream and the company's internet would

36
00:02:29,160 --> 00:02:29,880
be reliable.

37
00:02:29,880 --> 00:02:30,780
And it wasn't.

38
00:02:30,780 --> 00:02:35,310
It was going down every day and required someone to restart the server.

39
00:02:35,790 --> 00:02:38,460
So after a couple of hours, we just wrote up this function.

40
00:02:38,970 --> 00:02:42,240
It was a function we found online, but we just made some changes to it.

41
00:02:42,640 --> 00:02:47,700
And though I'm sharing it with you guys, so this is a pretty cool piece of code here.

42
00:02:48,450 --> 00:02:50,640
Hopefully, we might use it in some of the applications.

43
00:02:51,120 --> 00:02:57,090
Thank you for this chapter, for watching this chapter, and we'll move on now to capturing video using

44
00:02:57,090 --> 00:02:57,840
screenshots.

45
00:02:57,840 --> 00:03:01,200
And I'll explain to you what that is in the next section.

46
00:03:01,440 --> 00:03:01,950
Thank you.
