Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
b2d4a63c
Commit
b2d4a63c
authored
Mar 06, 2019
by
Steven Ye
Committed by
Evan W. Patton
Mar 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Stop method to VideoPlayer
Change-Id: I09bec5aca529b51746d3b56a5f2c4c9a4bcf5eea
parent
0d3098ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
52 deletions
+53
-52
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
...nventor/client/youngandroid/YoungAndroidFormUpgrader.java
+9
-4
appinventor/blocklyeditor/src/versioning.js
appinventor/blocklyeditor/src/versioning.js
+4
-1
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
...c/com/google/appinventor/components/common/YaVersion.java
+7
-3
appinventor/components/src/com/google/appinventor/components/runtime/VideoPlayer.java
...om/google/appinventor/components/runtime/VideoPlayer.java
+12
-0
appinventor/components/src/com/google/appinventor/components/runtime/util/FullScreenVideoUtil.java
...inventor/components/runtime/util/FullScreenVideoUtil.java
+21
-44
No files found.
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
View file @
b2d4a63c
...
@@ -1397,10 +1397,15 @@ public final class YoungAndroidFormUpgrader {
...
@@ -1397,10 +1397,15 @@ public final class YoungAndroidFormUpgrader {
srcCompVersion
=
4
;
srcCompVersion
=
4
;
}
}
if
(
srcCompVersion
<
5
)
{
if
(
srcCompVersion
<
5
)
{
// The Volume property (setter only) was created.
// The Volume property (setter only) was created.
// No properties need to be modified to upgrade to version 4.
// No properties need to be modified to upgrade to version 5.
srcCompVersion
=
5
;
srcCompVersion
=
5
;
}
}
if
(
srcCompVersion
<
6
)
{
// The Stop method was created.
// No properties need to be modified to upgrade to version 6.
srcCompVersion
=
6
;
}
return
srcCompVersion
;
return
srcCompVersion
;
}
}
...
...
appinventor/blocklyeditor/src/versioning.js
View file @
b2d4a63c
...
@@ -2509,7 +2509,10 @@ Blockly.Versioning.AllUpgradeMaps =
...
@@ -2509,7 +2509,10 @@ Blockly.Versioning.AllUpgradeMaps =
4
:
"
noUpgrade
"
,
4
:
"
noUpgrade
"
,
// AI2: The Volume property (setter only) was added to the VideoPlayer.
// AI2: The Volume property (setter only) was added to the VideoPlayer.
5
:
"
noUpgrade
"
5
:
"
noUpgrade
"
,
// AI2: Stop method was added to the VideoPlayer.
6
:
"
noUpgrade
"
},
// End VideoPlayer upgraders
},
// End VideoPlayer upgraders
...
...
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
View file @
b2d4a63c
...
@@ -444,10 +444,12 @@ public class YaVersion {
...
@@ -444,10 +444,12 @@ public class YaVersion {
// - NOTIFIER_COMPONENT_VERSION was incremented to 6
// - NOTIFIER_COMPONENT_VERSION was incremented to 6
// For YOUNG_ANDROID_VERSION 178:
// For YOUNG_ANDROID_VERSION 178:
// - CLOCK_COMPONENT_VERSION was incremented to 4
// - CLOCK_COMPONENT_VERSION was incremented to 4
// For YOUNG_ANDROID_VER
IS
ON 179:
// For YOUNG_ANDROID_VER
SI
ON 179:
// - BLOCKS_LANGUAGE_VERSION was incremented to 24
// - BLOCKS_LANGUAGE_VERSION was incremented to 24
// For YOUNG_ANDROID_VERSION 180:
// - VIDEOPLAYER_COMPONENT_VERSION was incremented to 6
public
static
final
int
YOUNG_ANDROID_VERSION
=
1
79
;
public
static
final
int
YOUNG_ANDROID_VERSION
=
1
80
;
// ............................... Blocks Language Version Number ...............................
// ............................... Blocks Language Version Number ...............................
...
@@ -1156,7 +1158,9 @@ public class YaVersion {
...
@@ -1156,7 +1158,9 @@ public class YaVersion {
// - The FullScreen property was added to the VideoPlayer.
// - The FullScreen property was added to the VideoPlayer.
// For VIDEOPLAYER_COMPONENT_VERSION 5:
// For VIDEOPLAYER_COMPONENT_VERSION 5:
// - The Volume property (setter only) was added to the VideoPlayer.
// - The Volume property (setter only) was added to the VideoPlayer.
public
static
final
int
VIDEOPLAYER_COMPONENT_VERSION
=
5
;
// For VIDEOPLAYER_COMPONENT_VERSION 6:
// - The Stop method was added to the VideoPlayer.
public
static
final
int
VIDEOPLAYER_COMPONENT_VERSION
=
6
;
public
static
final
int
VOTING_COMPONENT_VERSION
=
1
;
public
static
final
int
VOTING_COMPONENT_VERSION
=
1
;
...
...
appinventor/components/src/com/google/appinventor/components/runtime/VideoPlayer.java
View file @
b2d4a63c
...
@@ -283,6 +283,18 @@ public final class VideoPlayer extends AndroidViewComponent implements
...
@@ -283,6 +283,18 @@ public final class VideoPlayer extends AndroidViewComponent implements
}
}
}
}
@SimpleFunction
(
description
=
"Resets to start of video and pauses it if video was playing."
)
public
void
Stop
()
{
Log
.
i
(
"VideoPlayer"
,
"Calling Stop"
);
// Call start() to ensure frame shown is updated;
// Otherwise stopping while a video is on pause will not refresh its view
// until video is started again.
Start
();
SeekTo
(
0
);
Pause
();
}
@SimpleFunction
(
@SimpleFunction
(
description
=
"Seeks to the requested time (specified in milliseconds) in the video. "
+
description
=
"Seeks to the requested time (specified in milliseconds) in the video. "
+
"If the video is paused, the frame shown will not be updated by the seek. "
+
"If the video is paused, the frame shown will not be updated by the seek. "
+
...
...
appinventor/components/src/com/google/appinventor/components/runtime/util/FullScreenVideoUtil.java
View file @
b2d4a63c
...
@@ -103,50 +103,27 @@ public class FullScreenVideoUtil implements OnCompletionListener,
...
@@ -103,50 +103,27 @@ public class FullScreenVideoUtil implements OnCompletionListener,
mForm
=
form
;
mForm
=
form
;
mHandler
=
handler
;
mHandler
=
handler
;
if
(
SdkLevel
.
getLevel
()
>
SdkLevel
.
LEVEL_DONUT
)
{
mFullScreenVideoDialog
=
new
Dialog
(
mForm
,
mFullScreenVideoDialog
=
new
Dialog
(
mForm
,
R
.
style
.
Theme_NoTitleBar_Fullscreen
)
{
R
.
style
.
Theme_NoTitleBar_Fullscreen
)
{
public
void
onBackPressed
()
{
public
void
onBackPressed
()
{
// Allows the user to force exiting full-screen.
// Allows the user to force exiting full-screen.
Bundle
values
=
new
Bundle
();
Bundle
values
=
new
Bundle
();
values
.
putInt
(
VIDEOPLAYER_POSITION
,
values
.
putInt
(
VIDEOPLAYER_POSITION
,
mFullScreenVideoView
.
getCurrentPosition
());
mFullScreenVideoView
.
getCurrentPosition
());
values
.
putBoolean
(
VIDEOPLAYER_PLAYING
,
values
.
putBoolean
(
VIDEOPLAYER_PLAYING
,
mFullScreenVideoView
.
isPlaying
());
mFullScreenVideoView
.
isPlaying
());
values
.
putString
(
VIDEOPLAYER_SOURCE
,
values
.
putString
(
VIDEOPLAYER_SOURCE
,
mFullScreenVideoBundle
.
getString
(
VIDEOPLAYER_SOURCE
));
mFullScreenVideoBundle
.
getString
(
VIDEOPLAYER_SOURCE
));
mFullScreenPlayer
.
fullScreenKilled
(
values
);
mFullScreenPlayer
.
fullScreenKilled
(
values
);
super
.
onBackPressed
();
super
.
onBackPressed
();
}
}
public
void
onStart
()
{
public
void
onStart
()
{
super
.
onStart
();
super
.
onStart
();
// Prepare the Dialog media.
// Prepare the Dialog media.
startDialog
();
startDialog
();
}
}
};
};
}
else
{
mFullScreenVideoDialog
=
new
Dialog
(
mForm
,
R
.
style
.
Theme_NoTitleBar_Fullscreen
)
{
protected
void
onStop
()
{
Bundle
values
=
new
Bundle
();
values
.
putInt
(
VIDEOPLAYER_POSITION
,
mFullScreenVideoView
.
getCurrentPosition
());
values
.
putBoolean
(
VIDEOPLAYER_PLAYING
,
mFullScreenVideoView
.
isPlaying
());
values
.
putString
(
VIDEOPLAYER_SOURCE
,
mFullScreenVideoBundle
.
getString
(
VIDEOPLAYER_SOURCE
));
mFullScreenPlayer
.
fullScreenKilled
(
values
);
super
.
onStop
();
}
public
void
onStart
()
{
super
.
onStart
();
// Prepare the Dialog media.
startDialog
();
}
};
}
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment