
1
00:00:02.0000 --> 00:00:06.0000
want to make a video application we can
想製作一個視頻應用程式, 我們可以

2
00:00:06.0001 --> 00:00:27.0000
record flat back like this
像這樣記錄平背

3
00:00:27.0001 --> 00:00:45.0000
well watch this tutorial
以及觀看本教程

4
00:00:45.0001 --> 00:00:48.0000
welcome to knowledge app tutorials my
歡迎使用知識應用程式教程我的

5
00:00:48.0001 --> 00:00:50.0000
name's Nigel this tutorial is going to
名稱的奈傑爾本教程將

6
00:00:50.0001 --> 00:00:54.0000
show you how to build a video app the
教你如何建立一個視頻應用程式的

7
00:00:54.0001 --> 00:00:56.0000
story will be based on a lot of the
故事將根據很多的

8
00:00:56.0001 --> 00:00:58.0000
concepts from the previous how to create
從前面的概念如何創建

9
00:00:58.0001 --> 00:01:02.0000
a camera app using intents so if I go
相機應用程式使用的意圖, 所以如果我去

10
00:01:02.0001 --> 00:01:05.0000
too quickly on this tutorial you may
在本教程很快, 你可能會

11
00:01:05.0001 --> 00:01:06.0000
want to look at that tutorial series
想看看這個教程系列

12
00:01:06.0001 --> 00:01:11.0000
first let's make a start shall we let's
首先讓我們做一個開始, 我們應該讓我們的

13
00:01:11.0001 --> 00:01:20.0000
create a new project called a video app
創建一個稱為視頻應用程式的新專案

14
00:01:20.0001 --> 00:01:25.0000
I'm still using 5.0 I do need upgrade my
我仍然使用 5.0, 我需要升級我的

15
00:01:25.0001 --> 00:01:28.0000
Nexus and use a blank tivity don't
連結和使用一個空白的活性不

16
00:01:28.0001 --> 00:01:31.0000
needle with extra fluff I just add video
針額外的絨毛, 我只是添加視頻

17
00:01:31.0001 --> 00:01:37.0000
app in front of this and finish now
應用程式在這之前, 現在完成

18
00:01:37.0001 --> 00:01:42.0000
let's wait for it to build okay the
讓我們等待它建立好嗎

19
00:01:42.0001 --> 00:01:45.0000
projects now completed its build its put
專案現已完成其建設其投入

20
00:01:45.0001 --> 00:01:50.0000
me into the layout into the XML file I'm
我的佈局到 XML 檔, 我

21
00:01:50.0001 --> 00:01:52.0000
the very first thing I want to do here
我想在這裡做的第一件事是

22
00:01:52.0001 --> 00:01:54.0000
is visualize what the application is
是視覺化應用程式是什麼

23
00:01:54.0001 --> 00:01:57.0000
going to look like so I'll do that from
要看起來像這樣, 我會做到這一點, 從

24
00:01:57.0001 --> 00:02:00.0000
inside the layouts and basically I want
裡面的佈局, 基本上我想

25
00:02:00.0001 --> 00:02:03.0000
to have my applications going to have a
我的應用程式將有一個

26
00:02:03.0001 --> 00:02:06.0000
record button to record a video a play
記錄按鈕錄製視頻播放

27
00:02:06.0001 --> 00:02:09.0000
button to play back what I recorded and
按鈕來播放我記錄和

28
00:02:09.0001 --> 00:02:12.0000
it needs a video view just to display
它需要一個視頻視圖只是為了顯示

29
00:02:12.0001 --> 00:02:17.0000
the recording so I'm going to go into
記錄, 所以我要進入

30
00:02:17.0001 --> 00:02:22.0000
design here okay are the three sighs my
這裡的設計是三符號我

31
00:02:22.0001 --> 00:02:26.0000
Augie okay I don't need to text whew
奧吉沒關係, 我不需要文字

32
00:02:26.0001 --> 00:02:28.0000
that comes with the hello world text
伴隨著你好的世界文本

33
00:02:28.0001 --> 00:02:31.0000
whew I can delete that first step is to
我可以刪除第一步是

34
00:02:31.0001 --> 00:02:36.0000
add two buttons just drag-and-drop them
添加兩個按鈕只需拖放它們

35
00:02:36.0001 --> 00:02:39.0000
first ones here I want to drag that to
第一個在這裡, 我想把它拖到

36
00:02:39.0001 --> 00:02:44.0000
the bottom here one another button and
底部這裡一個另一個按鈕和

37
00:02:44.0001 --> 00:02:50.0000
I'll drag and drop that here and also on
我將拖放在這裡, 也在

38
00:02:50.0001 --> 00:02:52.0000
a video view to sit on top of the
一個視頻視圖坐在頂部的

39
00:02:52.0001 --> 00:02:55.0000
buttons so let's see if I can find the
按鈕, 讓我們看看, 如果我能找到

40
00:02:55.0001 --> 00:02:57.0000
video view is a video view
視頻視圖是視頻視圖

41
00:02:57.0001 --> 00:03:02.0000
in drag that into this play and resize
在拖動到此播放和調整大小

42
00:03:02.0001 --> 00:03:06.0000
it sits on top of the buttons because if
它坐在按鈕的頂部, 因為如果

43
00:03:06.0001 --> 00:03:08.0000
we go into text you'll see it's a
我們進入文本, 你會看到這是一個

44
00:03:08.0001 --> 00:03:11.0000
relative layout so you can adjust views
相對佈局, 以便您可以調整視圖

45
00:03:11.0001 --> 00:03:14.0000
relative to each other on top underneath
相對的在上面的頂部

46
00:03:14.0001 --> 00:03:17.0000
to the right off to the left off that's
右下到左關閉, 這是

47
00:03:17.0001 --> 00:03:20.0000
what the relative layout gives us okay
什麼樣的相對佈局給我們好嗎

48
00:03:20.0001 --> 00:03:22.0000
I'm happy with that but I do need to
我很高興, 但我確實需要

49
00:03:22.0001 --> 00:03:25.0000
rename my buttons so I know which button
重命名我的按鈕, 所以我知道哪個按鈕

50
00:03:25.0001 --> 00:03:28.0000
to press so this button here I'm going
按下這個按鈕, 我要去

51
00:03:28.0001 --> 00:03:33.0000
to want to call record let's find the
要調用記錄, 讓我們找到

52
00:03:33.0001 --> 00:03:43.0000
text for that I also want to change the
文本, 我也想改變

53
00:03:43.0001 --> 00:03:45.0000
ID to give it a bit more of a context so
ID 給它多一點的上下文, 所以

54
00:03:45.0001 --> 00:03:52.0000
I just want to call it the record button
我只想把它叫做記錄按鈕

55
00:03:52.0001 --> 00:03:59.0000
okay that's okay for me say yes to that
好吧, 沒關係, 我說是的,

56
00:03:59.0001 --> 00:04:01.0000
I want to update all the references to
我要更新所有引用到

57
00:04:01.0001 --> 00:04:07.0000
that ID okay the next step here is just
這個 ID 沒關係, 下一步是只是

58
00:04:07.0001 --> 00:04:12.0000
to do the same for button two and I want
做同樣的按鈕二, 我想

59
00:04:12.0001 --> 00:04:19.0000
to give button two an ID of play button
給按鈕兩個 "播放" 按鈕的 ID

60
00:04:19.0001 --> 00:04:29.0000
and I want to change the text to display
我想更改要顯示的文本

61
00:04:29.0001 --> 00:04:32.0000
okay I am now happier with the look and
好吧, 我現在更高興的外觀和

62
00:04:32.0001 --> 00:04:34.0000
feel of what my application is going to
感覺我的應用程式將

63
00:04:34.0001 --> 00:04:37.0000
look like if we pop into the text tab
看起來像如果我們彈出到文本選項卡

64
00:04:37.0001 --> 00:04:38.0000
we'll see
我們會看到

65
00:04:38.0001 --> 00:04:40.0000
yes we've got the two button views and
是的, 我們有兩個按鈕視圖和

66
00:04:40.0001 --> 00:04:42.0000
our video view and you can see how
我們的視頻視圖, 你可以看到如何

67
00:04:42.0001 --> 00:04:46.0000
relative views can align with the
相對視圖可以與

68
00:04:46.0001 --> 00:04:50.0000
parents and you can also align like the
家長和您也可以像

69
00:04:50.0001 --> 00:04:52.0000
video view to sit on top of one of the
視頻視圖坐在頂部的一個

70
00:04:52.0001 --> 00:04:55.0000
buttons and it's also centering
按鈕, 它也居中

71
00:04:55.0001 --> 00:04:56.0000
horizontal so hopefully the video views
水準, 所以希望視頻視圖

72
00:04:56.0001 --> 00:04:59.0000
going to certain them at all okay so I'm
去肯定他們在所有沒關係, 所以我

73
00:04:59.0001 --> 00:05:02.0000
now happy with that the next step I want
現在高興的是, 我想要的下一個步驟

74
00:05:02.0001 --> 00:05:06.0000
to do is this start setting click
要做的是這個開始設置按一下

75
00:05:06.0001 --> 00:05:10.0000
functionality to my buttons and the
功能到我的按鈕和

76
00:05:10.0001 --> 00:05:14.0000
previous camera app tutorial we use the
以前的相機應用程式教程, 我們使用的

77
00:05:14.0001 --> 00:05:17.0000
on clip functionality that was provided
在提供的剪輯功能上

78
00:05:17.0001 --> 00:05:20.0000
to us by the button view and there's
我們的按鈕視圖, 並有

79
00:05:20.0001 --> 00:05:22.0000
also an entire number of other methods
並且其他方法的整個數位

80
00:05:22.0001 --> 00:05:25.0000
to add onclicklistener as well and so
添加 onclicklistener 以及等

81
00:05:25.0001 --> 00:05:27.0000
I'm going to show you another method of
我要給你看另一種方法

82
00:05:27.0001 --> 00:05:29.0000
how will you do that so we go into the
你將如何做到這一點, 所以我們進入

83
00:05:29.0001 --> 00:05:35.0000
code so I go into the oncreate function
代碼, 所以我進入 oncreate 功能

84
00:05:35.0001 --> 00:05:38.0000
where all the initialization happens up
所有初始化發生的地方

85
00:05:38.0001 --> 00:05:41.0000
if it's me just go into my empty class
如果是我就進入我的空課

86
00:05:41.0001 --> 00:05:43.0000
first I am going to need to create some
首先, 我將需要創建一些

87
00:05:43.0001 --> 00:05:46.0000
variables for my buttons and for my
變數為我的按鈕和我的

88
00:05:46.0001 --> 00:05:49.0000
video view first let me do the buttons
視頻視圖首先讓我做按鈕

89
00:05:49.0001 --> 00:05:52.0000
and I'll create two variables for play
我會為遊戲創建兩個變數

90
00:05:52.0001 --> 00:05:54.0000
and for the record and play button
記錄和播放按鈕

91
00:05:54.0001 --> 00:06:03.0000
so first final to see in record few
所以第一次決賽看到在創紀錄的少數

92
00:06:03.0001 --> 00:06:11.0000
another one will be in play whew okay
另外一個將在發揮, 好嗎

93
00:06:11.0001 --> 00:06:23.0000
let's make it private
讓我們把它保密

94
00:06:23.0001 --> 00:06:26.0000
okay and I'm going to do the same thing
好吧, 我會做同樣的事情

95
00:06:26.0001 --> 00:06:34.0000
again here for the video view I think I
再次在這裡的視頻視圖, 我想我

96
00:06:34.0001 --> 00:06:41.0000
just call this in video view so I'm
只是在視頻視圖調用這個, 所以我

97
00:06:41.0001 --> 00:06:44.0000
happy with those buttons now I want to create
快樂的按鈕, 現在我想創建

98
00:06:44.0001 --> 00:06:50.0000
I want to initialize my views from the
我要初始化我的視圖。

99
00:06:50.0001 --> 00:06:52.0000
layout from the views from the layout
從佈局視圖中進行佈局

100
00:06:52.0001 --> 00:07:00.0000
sunsets do that down here do you record
日落這樣做, 在這裡你記錄

101
00:07:00.0001 --> 00:07:03.0000
view first and will initialize I record
首先查看並將初始化 I 記錄

102
00:07:03.0001 --> 00:07:07.0000
view with the button from the layout you
使用佈局中的按鈕查看

103
00:07:07.0001 --> 00:07:16.0000
have to cast at first so it's going to
首先要投, 所以它會

104
00:07:16.0001 --> 00:07:21.0000
be record button and we'll do the same
是記錄按鈕, 我們會做同樣的

105
00:07:21.0001 --> 00:07:37.0000
thing for the play button
遊戲按鈕的事情

106
00:07:37.0001 --> 00:07:45.0000
and play button and let's initialize our
和播放按鈕, 讓我們初始化我們的

107
00:07:45.0001 --> 00:07:50.0000
video view as well and again we need to
視頻視圖, 以及我們需要再次

108
00:07:50.0001 --> 00:08:05.0000
cast that
投那

109
00:08:05.0001 --> 00:08:11.0000
okay I've now initialized my views next
好吧, 我現在初始化我的觀點下

110
00:08:11.0001 --> 00:08:12.0000
step is I want to create that on clip
步驟是, 我想創建在剪輯

111
00:08:12.0001 --> 00:08:15.0000
functionality to my record button and my
功能到我的記錄按鈕和我的

112
00:08:15.0001 --> 00:08:20.0000
play button and to do that we can add
播放按鈕, 並做到這一點, 我們可以添加

113
00:08:20.0001 --> 00:08:21.0000
what's called a onclicklistener
什麼叫 onclicklistener

114
00:08:21.0001 --> 00:08:25.0000
object and assign that set that up with
物件和分配, 該值設置為

115
00:08:25.0001 --> 00:08:31.0000
our view you can do that with any of you
我們的看法, 你可以這樣做與任何人

116
00:08:31.0001 --> 00:08:34.0000
so what's a set onclicklistener
那麼, 什麼是一個設置 onclicklistener

117
00:08:34.0001 --> 00:08:35.0000
and then we create a new onclicklistener
然後我們創建一個新的 onclicklistener

118
00:08:35.0001 --> 00:08:44.0000
object here do the wonderful magic of
這裡的物件做奇妙的魔術

119
00:08:44.0001 --> 00:08:46.0000
Android studio it's already populated
Android 工作室, 它已經填充

120
00:08:46.0001 --> 00:08:52.0000
the function for me now let's do the
我現在的功能, 讓我們做的

121
00:08:52.0001 --> 00:09:12.0000
same for the play button as well
同樣的播放按鈕, 以及

122
00:09:12.0001 --> 00:09:16.0000
okay so we've now created our
好了, 所以我們現在已經創建了我們的

123
00:09:16.0001 --> 00:09:19.0000
onclicklistener x' our buttons are now
onclicklistener x ' 我們的按鈕現在

124
00:09:19.0001 --> 00:09:22.0000
going to respond to key presses the next
要回應鍵按下

125
00:09:22.0001 --> 00:09:25.0000
step is let's start working on our
步驟是讓我們開始工作, 我們的

126
00:09:25.0001 --> 00:09:27.0000
record button our record buttons just
記錄按鈕我們的記錄按鈕只是

127
00:09:27.0001 --> 00:09:31.0000
going to call an external application
要調用外部應用程式

128
00:09:31.0001 --> 00:09:34.0000
that can record video so and we're going
可以錄製視頻, 所以我們要

129
00:09:34.0001 --> 00:09:37.0000
to use the exact same methodology that
使用完全相同的方法,

130
00:09:37.0001 --> 00:09:39.0000
we used in the camera and tenth video
我們使用的相機和第十視頻

131
00:09:39.0001 --> 00:09:45.0000
app camera and tenth application the
應用相機和第十應用程式的

132
00:09:45.0001 --> 00:09:45.0000
first thing here we want to create an
第一件事, 我們要創建一個

133
00:09:46.0001 --> 00:09:52.0000
intense I should I call this intent
強烈的, 我應該叫這個意圖

134
00:09:52.0001 --> 00:10:05.0000
um call video
調用視頻

135
00:10:05.0001 --> 00:10:15.0000
and create a new intent
並創建一個新的意圖

136
00:10:15.0001 --> 00:10:20.0000
create a new attempt as with the camera
使用觀景窗創建新嘗試

137
00:10:20.0001 --> 00:10:22.0000
app we're going to actually have to
應用程式, 我們要實際上必須

138
00:10:22.0001 --> 00:10:25.0000
provide an action so any video
提供操作, 使任何視頻

139
00:10:25.0001 --> 00:10:28.0000
application that can play video will be
可以播放視頻的應用程式將被

140
00:10:28.0001 --> 00:10:40.0000
able to respond to our intent so
能夠回應我們的意圖, 所以

141
00:10:40.0001 --> 00:10:42.0000
and again we're going to use the media
再次, 我們要使用媒體

142
00:10:42.0001 --> 00:10:51.0000
store and it's going to be the name of
商店, 它將是名稱

143
00:10:51.0001 --> 00:10:52.0000
the action it's going to be called
它的行動將被稱為

144
00:10:52.0001 --> 00:10:56.0000
action video capture pretty
動作視頻捕捉漂亮

145
00:10:56.0001 --> 00:11:05.0000
self-explanatory
自我解釋

146
00:11:05.0001 --> 00:11:08.0000
okay let's just talk a little bit about
好吧, 讓我們只是談談一點點關於

147
00:11:08.0001 --> 00:11:15.0000
this action so every search for this
此操作, 因此每次搜索此

148
00:11:15.0001 --> 00:11:28.0000
while Google and here in the media store
而谷歌和這裡的媒體商店

149
00:11:28.0001 --> 00:11:31.0000
the developer's library click on that
開發人員的庫按一下該

150
00:11:31.0001 --> 00:11:34.0000
and basically it says it's a standard
基本上它說這是一個標準

151
00:11:34.0001 --> 00:11:38.0000
intent intent action that can be sent to
可以發送到的意向意向操作

152
00:11:38.0001 --> 00:11:40.0000
have a camera application capture a
有一個相機應用程式捕獲一個

153
00:11:40.0001 --> 00:11:42.0000
video for you so that's what I want I
視頻給你, 所以這就是我想要的, 我

154
00:11:42.0001 --> 00:11:45.0000
want a application that can capture
希望能夠捕獲的應用程式

155
00:11:45.0001 --> 00:11:47.0000
video to record a video for it and send
視頻錄製的視頻, 併發送

156
00:11:47.0001 --> 00:11:51.0000
it back to my application back to the
它回到我的應用程式返回到

157
00:11:51.0001 --> 00:11:54.0000
code okay so I've got my intent here
代碼好吧, 所以我有我的意圖在這裡

158
00:11:54.0001 --> 00:11:57.0000
it's just a simple matter of starting an
這只是一個簡單的問題, 啟動一個

159
00:11:57.0001 --> 00:12:00.0000
activity that will call our camera
活動, 將調用我們的相機

160
00:12:00.0001 --> 00:12:04.0000
Application
應用

161
00:12:04.0001 --> 00:12:08.0000
so start we use startactivityforresult
所以開始我們使用 startactivityforresult

162
00:12:08.0001 --> 00:12:11.0000
in other words once we've called the
換句話說, 一旦我們調用了

163
00:12:11.0001 --> 00:12:13.0000
camera application and it's finished
觀景窗應用和它的完成

164
00:12:13.0001 --> 00:12:17.0000
capturing our video we want that
捕捉我們的視頻, 我們希望,

165
00:12:17.0001 --> 00:12:23.0000
application to return back to us so
應用程式返回給我們, 所以

166
00:12:23.0001 --> 00:12:26.0000
that's that activity for result we pass
這是我們通過的結果的活動

167
00:12:26.0001 --> 00:12:31.0000
it on 10 that were just created and we
它在10剛剛創建, 我們

168
00:12:31.0001 --> 00:12:32.0000
need to request code which we haven't
需要請求代碼, 我們還沒有

169
00:12:32.0001 --> 00:12:34.0000
yet created so we'll create that creep
但創造, 所以我們將創造的蠕變

170
00:12:34.0001 --> 00:12:36.0000
request code it's going to be another
請求代碼這將是另一個

171
00:12:36.0001 --> 00:12:44.0000
variable quest codes and nuts and I'll
可變的追求代碼和堅果, 我會

172
00:12:44.0001 --> 00:12:57.0000
call it a tip pity start camera
稱它為提示憐憫啟動攝像頭

173
00:12:57.0001 --> 00:13:01.0000
and assign a value of zero and we'll put
並分配一個值為零, 我們將把

174
00:13:01.0001 --> 00:13:16.0000
that into our start activity request
到我們的開始活動請求

175
00:13:16.0001 --> 00:13:23.0000
and that's it for the for recording our
這是為記錄我們的

176
00:13:23.0001 --> 00:13:28.0000
video okay now the next step here is
視頻好了, 現在下一步是

177
00:13:28.0001 --> 00:13:30.0000
once through videos being kept and
一旦通過視頻被保存和

178
00:13:30.0001 --> 00:13:33.0000
returned back to our application we need
回到我們的應用程式, 我們需要

179
00:13:33.0001 --> 00:13:37.0000
to capture the response and an on
捕獲回應和 on

180
00:13:37.0001 --> 00:13:39.0000
activity result function so let's put
活動結果函數讓我們把

181
00:13:39.0001 --> 00:13:54.0000
that in there
在那裡

182
00:13:54.0001 --> 00:14:04.0000
and the first one is our request code
第一個是我們的請求代碼

183
00:14:04.0001 --> 00:14:06.0000
second is going to be the result code
第二個將是結果代碼

184
00:14:06.0001 --> 00:14:10.0000
whether or not the whether or not the
是否該

185
00:14:10.0001 --> 00:14:19.0000
request was successful and the third
請求成功, 第三個

186
00:14:19.0001 --> 00:14:21.0000
one's going to be an intent returned
一個將是一個意圖返回

187
00:14:21.0001 --> 00:14:23.0000
back to us that's going to contain the
回到我們將包含的

188
00:14:23.0001 --> 00:14:27.0000
location of the video that was captured
捕獲的視頻位置

189
00:14:27.0001 --> 00:14:36.0000
that would be an intent we call it data
這將是一個意圖, 我們稱之為資料

190
00:14:36.0001 --> 00:14:40.0000
okay so first thing first is we just put
好吧, 首先是我們只是把

191
00:14:40.0001 --> 00:14:43.0000
a bit of filtering code to make sure we
一些過濾代碼, 以確保我們

192
00:14:43.0001 --> 00:14:45.0000
are getting a successful result and our
取得了成功的結果, 我們的

193
00:14:45.0001 --> 00:14:56.0000
request code back so if we quest code
請求代碼回來, 所以如果我們尋求代碼

194
00:14:56.0001 --> 00:15:03.0000
equals 2 to start camera wrap and of
等於2開始相機包裝和

195
00:15:03.0001 --> 00:15:14.0000
result code equals result okay we will
結果代碼等於結果好吧, 我們會

196
00:15:14.0001 --> 00:15:21.0000
then process what's happened and we're
然後處理發生了什麼事, 我們是

197
00:15:21.0001 --> 00:15:26.0000
not sign-in when comparing it okay so
不登錄時, 比較沒關係, 所以

198
00:15:26.0001 --> 00:15:29.0000
the next step here is to actually inside
接下來的步驟是在裡面

199
00:15:29.0001 --> 00:15:36.0000
the intent data argument we have that
目的資料參數, 我們有,

200
00:15:36.0001 --> 00:15:41.0000
that will provide us with the URI of the
這將為我們提供的 URI

201
00:15:41.0001 --> 00:15:43.0000
location of the video image that was
視頻圖像的位置

202
00:15:43.0001 --> 00:15:48.0000
captured by the video application so we
捕獲的視頻應用程式, 所以我們

203
00:15:48.0001 --> 00:15:51.0000
need to create a URI
需要創建 URI

204
00:15:51.0001 --> 00:16:00.0000
variable so it's a video you are I and
變數, 所以它是一個視頻, 你是我和

205
00:16:00.0001 --> 00:16:06.0000
from here we can use the data
從這裡我們可以使用資料

206
00:16:06.0001 --> 00:16:11.0000
get data function so this get data
獲取資料函數, 以便獲取資料

207
00:16:11.0001 --> 00:16:13.0000
function is actually returned to us the
函數實際上是返回給我們的

208
00:16:13.0001 --> 00:16:17.0000
URI of whether video was captured and
是否捕獲視頻的 URI 和

209
00:16:17.0001 --> 00:16:19.0000
after that is just a simple matter of
之後, 只是一個簡單的問題

210
00:16:19.0001 --> 00:16:23.0000
signing that URI to our actual video
將 URI 簽名到我們的實際視頻

212
00:16:23.0001 --> 00:16:33.0000
view so set video URI pretty
視圖, 所以設置視頻 URI 漂亮

213
00:16:33.0001 --> 00:16:38.0000
self-explanatory and we pass it the URI
自我解釋, 我們通過它的 URI

214
00:16:38.0001 --> 00:16:44.0000
that we just set up okay let's now
我們只是設置好了, 讓我們現在

215
00:16:44.0001 --> 00:16:46.0000
happen so once we've captured the video
發生, 所以一旦我們抓住了視頻

216
00:16:46.0001 --> 00:16:49.0000
we want to start playing the video so we
我們想開始播放視頻, 所以我們

217
00:16:49.0001 --> 00:16:52.0000
need to call that in a place where we're
需要調用它在一個地方, 我們是

218
00:16:52.0001 --> 00:16:53.0000
going to call that it's going to be from
要調用, 這將是從

219
00:16:53.0001 --> 00:16:56.0000
the play button so if we go back up to
播放按鈕, 所以如果我們回到

220
00:16:56.0001 --> 00:17:03.0000
the play button okay I made a little
播放按鈕好吧, 我做了一個小

221
00:17:03.0001 --> 00:17:09.0000
boo-boo the code that goes into the
噓噓代碼進入

222
00:17:09.0001 --> 00:17:12.0000
record I've put into the play so we're
記錄, 我已經把這齣戲, 所以我們

223
00:17:12.0001 --> 00:17:14.0000
just going to move that few lines of
只是要移動這幾行

224
00:17:14.0001 --> 00:17:16.0000
code and put it into record and then in
代碼, 並把它記錄在案, 然後在

225
00:17:16.0001 --> 00:17:21.0000
order to play properly so from Lions 41
為了正確發揮, 所以從獅子41

226
00:17:21.0001 --> 00:17:32.0000
to 44 we just need to cut and paste
到 44, 我們只需要剪切和粘貼

227
00:17:32.0001 --> 00:17:35.0000
and go up to here
然後到這裡來

228
00:17:35.0001 --> 00:17:41.0000
and the space below so out so we've now
和下面的空間, 所以我們現在已經

229
00:17:41.0001 --> 00:17:45.0000
fixed our record button let's go into
修正了我們的記錄按鈕, 讓我們進入

230
00:17:45.0001 --> 00:17:48.0000
the play button and add the code that
播放按鈕, 並添加代碼,

231
00:17:48.0001 --> 00:17:53.0000
actual will play the video so we need to
實際將播放視頻, 所以我們需要

232
00:17:53.0001 --> 00:17:55.0000
in video view and it's just a matter of
在視頻視圖, 這只是一個問題的

233
00:17:55.0001 --> 00:18:02.0000
courting start just a quick check on the
求愛開始只是一個快速檢查

234
00:18:02.0001 --> 00:18:04.0000
right hand side so you've got any red
右手邊, 所以你有任何紅色

235
00:18:04.0001 --> 00:18:09.0000
bars for any errors this looks okay okay
酒吧的任何錯誤, 這看起來不錯好嗎

236
00:18:09.0001 --> 00:18:11.0000
so this looks okay let's try running the
所以這看起來不錯, 讓我們嘗試運行

237
00:18:11.0001 --> 00:18:34.0000
application and see what happens
應用程式, 看看會發生什麼

238
00:18:34.0001 --> 00:18:42.0000
now as usual I'm going to record that so
現在像往常一樣, 我要記錄, 所以

239
00:18:42.0001 --> 00:18:45.0000
applications now started that's what
應用程式現在開始, 這是什麼

240
00:18:45.0001 --> 00:18:48.0000
this is what it looks like so we'll
這是什麼樣子, 所以我們會

241
00:18:48.0001 --> 00:18:53.0000
press the record button we've started up
按下我們開始的記錄按鈕

242
00:18:53.0001 --> 00:18:57.0000
a camera application I'm just going to
一個相機應用程式, 我只是要

243
00:18:57.0001 --> 00:19:02.0000
switch it and I'm just going to video I
切換它, 我只是去視頻我

244
00:19:02.0001 --> 00:19:14.0000
will it's enough accept that okay
這是否足夠接受, 好嗎

245
00:19:14.0001 --> 00:19:17.0000
applications now it's gone back to our
應用程式現在它已經回到我們的

246
00:19:17.0001 --> 00:19:19.0000
application let's click play and see
應用程式讓我們點擊播放, 看看

247
00:19:19.0001 --> 00:19:24.0000
what happens and we are now playing back
發生了什麼, 我們現在玩回

248
00:19:24.0001 --> 00:19:26.0000
the video that we recorded and that's
我們錄製的視頻, 這是

249
00:19:26.0001 --> 00:19:28.0000
that that's what we wanted our
這就是我們想要的

250
00:19:28.0001 --> 00:19:33.0000
application to do okay as with the
應用程式做沒關係, 因為與

251
00:19:33.0001 --> 00:19:35.0000
normal flow of these tutorials we're
這些教程的正常流程, 我們

252
00:19:35.0001 --> 00:19:37.0000
going to debug we're going to set up
要調試, 我們要設置

253
00:19:37.0001 --> 00:19:40.0000
some breakpoints and step through the
一些中斷點並逐步通過

254
00:19:40.0001 --> 00:19:43.0000
lines of code to actually see what we've
程式碼, 以實際看到我們已經

255
00:19:43.0001 --> 00:19:49.0000
done okay so I want to set up one and
做得好, 所以我想建立一個和

256
00:19:49.0001 --> 00:19:51.0000
the oncreate that's where we've created
我們創造的 oncreate

257
00:19:51.0001 --> 00:19:56.0000
our variables one here I want to put on
我們的變數之一, 在這裡我想穿上

258
00:19:56.0001 --> 00:20:00.0000
one in the on Requip activity request so
一個在 Requip 活動請求, 所以

259
00:20:00.0001 --> 00:20:02.0000
we see what happens to the Crest request
我們看到波峰請求會發生什麼

260
00:20:02.0001 --> 00:20:05.0000
whether it's successful or not and I
無論成功與否, 我

261
00:20:05.0001 --> 00:20:08.0000
also want to put some with our view on
也想把一些與我們的看法

262
00:20:08.0001 --> 00:20:11.0000
click listeners let's put one on here
按一下攔截器讓我們把一個在這裡

263
00:20:11.0001 --> 00:20:14.0000
for the record we'll put one on here for
記錄, 我們會把一個在這裡

264
00:20:14.0001 --> 00:20:18.0000
the view and that should be it that's
的看法, 應該是它的

265
00:20:18.0001 --> 00:20:21.0000
enough Brett points so we click on the
足夠的佈雷特點, 所以我們點擊

266
00:20:21.0001 --> 00:20:37.0000
debug button
調試 "按鈕

267
00:20:37.0001 --> 00:20:42.0000
and before the application fully
在應用程式完全

268
00:20:42.0001 --> 00:20:44.0000
initializes and turns on we've already
初始化和打開我們已經

269
00:20:44.0001 --> 00:20:47.0000
had our first breakpoint in the oncreate
有我們的第一個中斷點在 oncreate

270
00:20:47.0001 --> 00:20:50.0000
step for that so we assign our record
步驟, 所以我們分配我們的記錄

271
00:20:50.0001 --> 00:20:52.0000
view button with the view from the
視圖按鈕。

272
00:20:52.0001 --> 00:20:55.0000
layout same for the play button and the
佈局相同的播放按鈕和

273
00:20:55.0001 --> 00:20:58.0000
video view we sign it with the video
視頻視圖我們簽署它與視頻

274
00:20:58.0001 --> 00:21:01.0000
view from the layout now we create our
視圖從佈局現在我們創建我們的

275
00:21:01.0001 --> 00:21:04.0000
own click listeners for the record
自己的點擊攔截器記錄

276
00:21:04.0001 --> 00:21:08.0000
button and the play button and that's it
按鈕和播放按鈕, 這就是它

277
00:21:08.0001 --> 00:21:11.0000
this continue on my applications now
現在繼續我的應用程式

278
00:21:11.0001 --> 00:21:13.0000
start and now can start operating my
開始, 現在可以開始操作我的

279
00:21:13.0001 --> 00:21:18.0000
application first step is to record and
應用程式的第一步是記錄和

280
00:21:18.0001 --> 00:21:21.0000
I've put another breakpoint here and the
我在這裡放了另一個中斷點和

281
00:21:21.0001 --> 00:21:24.0000
first one is the record button here we
第一個是記錄按鈕, 我們在這裡

282
00:21:24.0001 --> 00:21:26.0000
know our on click listeners working okay
知道我們的點擊攔截器工作正常

285
00:21:26.0001 --> 00:21:30.0000
so we create our intent we give it an
所以我們創造我們的意圖, 我們給它一個

286
00:21:30.0001 --> 00:21:32.0000
action to call an external video
調用外部視頻的操作

287
00:21:32.0001 --> 00:21:34.0000
application then we start that
應用程式然後, 我們開始,

288
00:21:34.0001 --> 00:21:44.0000
application and continue on so the video
應用程式, 並繼續這樣的視頻

289
00:21:44.0001 --> 00:21:46.0000
application of called has responded and
調用的應用已作出反應, 並

290
00:21:46.0001 --> 00:21:49.0000
the started so you can press the record
開始, 所以你可以按下記錄

291
00:21:49.0001 --> 00:21:56.0000
button and record a war stop that
按鈕和記錄的戰爭停止,

292
00:21:56.0001 --> 00:22:00.0000
except that and I've had another
除了, 我已經有了另一個

293
00:22:00.0001 --> 00:22:01.0000
breakpoint applications no longer
中斷點應用程式不再

294
00:22:01.0001 --> 00:22:05.0000
running we're not on activity result so
運行, 我們不是在活動結果, 所以

295
00:22:05.0001 --> 00:22:08.0000
applications returned back to us so we
應用程式返回給我們, 所以我們

296
00:22:08.0001 --> 00:22:10.0000
can step through the code the first part
可以單一步驟代碼第一部分

297
00:22:10.0001 --> 00:22:11.0000
is let's check to see if it's our
是讓我們檢查, 看看它是否是我們的

298
00:22:11.0001 --> 00:22:15.0000
request it is ok from there we can
要求它是 ok, 從那裡我們可以

299
00:22:15.0001 --> 00:22:17.0000
actually get the location of the where
實際上得到的位置的地方

300
00:22:17.0001 --> 00:22:20.0000
the videos been saved to by the URI
視頻已由 URI 保存到

301
00:22:20.0001 --> 00:22:25.0000
and and then we just assign once we've
然後, 我們只是分配一旦我們已經

302
00:22:25.0001 --> 00:22:27.0000
got the URI we can just assign that URI
得到了 uri, 我們可以只分配該 uri

303
00:22:27.0001 --> 00:22:33.0000
to the video view
到視頻視圖

304
00:22:33.0001 --> 00:22:38.0000
okay now we've gone back to our
好了, 現在我們已經回到我們的

305
00:22:38.0001 --> 00:22:41.0000
application so nothing's going to happen
應用程式, 所以什麼都不會發生

306
00:22:41.0001 --> 00:22:47.0000
yet until I press play and soon as I
然而, 直到我按下播放, 很快, 因為我

307
00:22:47.0001 --> 00:22:48.0000
press play
新聞播放

308
00:22:48.0001 --> 00:22:50.0000
we've gone back into onclicklistener
我們回到了 onclicklistener

309
00:22:50.0001 --> 00:22:54.0000
here which is the for the play button so
這裡是播放按鈕, 所以

310
00:22:54.0001 --> 00:22:56.0000
nothing's going to happen until I hold
什麼都不會發生, 直到我抓住

311
00:22:56.0001 --> 00:23:00.0000
my shaky hand for you to see and press
我顫抖的手, 你看, 並按

312
00:23:00.0001 --> 00:23:06.0000
go again and we can see a bit of
再來一次, 我們可以看到一些

313
00:23:06.0001 --> 00:23:09.0000
movement of a picture of a video of a
一個視頻的圖片移動

314
00:23:09.0001 --> 00:23:18.0000
wall and that is it so what we learnt in
牆, 這是它, 所以我們學到的

315
00:23:18.0001 --> 00:23:20.0000
this tutorial is we learnt there's
本教程是我們學到有

316
00:23:20.0001 --> 00:23:24.0000
alternative ways of creating the click
創建按一下的其他方法

317
00:23:24.0001 --> 00:23:26.0000
events to listen to views when a user
事件來偵聽使用者的視圖

318
00:23:26.0001 --> 00:23:31.0000
presses on them we also use the learnt a
按在他們身上, 我們也使用學到的

319
00:23:31.0001 --> 00:23:36.0000
new intent action that allows us to call
新的意圖行動, 讓我們調用

320
00:23:36.0001 --> 00:23:40.0000
external video applications we got
我們得到的外部視頻應用程式

321
00:23:40.0001 --> 00:23:43.0000
introduced to your you are eyes and how
介紹給你你的眼睛和如何

322
00:23:43.0001 --> 00:23:48.0000
you can loader your I create URI and
你可以裝入你的我創建 URI 和

323
00:23:48.0001 --> 00:23:51.0000
assign that to a video view and then
將該值分配給視頻視圖, 然後

324 
00:23:51.0001 --> 00:23:52.0000
once you've got a video view you just
一旦你有一個視頻視圖, 你只是

325
00:23:52.0001 --> 00:23:55.0000
have to call play on it to play that
必須調用發揮它發揮

326
00:23:55.0001 --> 00:23:57.0000
content and so that's all for this
內容, 所以這一切都是為了這個

327
00:23:57.0001 --> 00:23:58.0000
Tutorial
教程

328
00:23:58.0001 --> 00:24:00.0000
most of this tutorial was based on the
本教程的大部分是基於

329
00:24:00.0001 --> 00:24:03.0000
previous tutorial the camera application
上一篇教程攝像機應用

330
00:24:03.0001 --> 00:24:05.0000
using intents but I wanted to go through
使用意圖, 但我想去通過

331
00:24:05.0001 --> 00:24:07.0000
this one at a bit of a faster pace and
這是一個有點快的速度和

332
00:24:07.0001 --> 00:24:10.0000
it's just a bit of a refresher of what
這只是一點點的複習什麼

333
00:24:10.0001 --> 00:24:14.0000
we learnt in that past video tutorial
我們在過去的視頻教程中學到了

334
00:24:14.0001 --> 00:24:17.0000
series if you like these tutorials don't
系列, 如果你喜歡這些教程不

335
00:24:17.0001 --> 00:24:20.0000
forget to subscribe and I do have a big
忘記訂閱, 我有一個大

336
00:24:20.0001 --> 00:24:23.0000
list in my mind of future content to
清單在我心目中的未來內容

337
00:24:23.0001 --> 00:24:26.0000
publish as well that's all for this one
發佈以及這是所有這一個

338
00:24:26.0001 --> 00:24:37.0000
bye for now
再見

339
00:24:37.0001 --> 00:24:41.0000
and take a photo of a cup of green tea
拍一杯綠茶的照片

340
00:24:41.0001 --> 00:24:53.0000
Again
再次

341
00:24:53.0001 --> 00:24:58.0000
and we have the actual image itself
我們有實際的圖像本身

342
00:24:58.0001 --> 00:25:01.0000
effectively nothing's changed from the
實際上什麼都沒有改變從

343
00:25:01.0001 --> 00:24:03.0000
previous tutorial except what I expect
以前的教程, 除了我的期望

344
00:25:03.0001 --> 00:24:08.0000
to see here is this but this flip map
看到這裡是這個, 但這個翻轉地圖

345
00:25:08.0001 --> 00:24:11.0000
emerge greatly reduced that we're not
出現大大減少, 我們不

346
00:25:11.0001 --> 00:24:14.0000
taking up too much rather the system
占了太多, 而系統

347
00:25:14.0001 --> 00:24:19.0000
everything happy with our phone ok we
所有的快樂與我們的電話 ok, 我們

348
00:25:19.0001 --> 00:24:20.0000
can stop recording now
現在可以停止錄製

