public class Video
extends Fragment
Template3
the user can press the play button
instantly.
Data collected here includes when the play and next buttons were pressed.
Modifier and Type | Field and Description |
---|---|
(package private) Activity |
activity
The instance of the current Activity
|
(package private) SSCallback |
callback
The instance of the
SSCallback that allows this fragment to
communicate with the parent activity. |
(package private) VideoView |
myVideoView
VideoView that displays the videos to the user.
|
(package private) ImageView |
playButton
Play button that the
myVideoView uses to begin the video |
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader class that reads in the dynamic
content for the application. |
(package private) boolean |
temp1Run1
boolean value indicating what template this fragment is currently apart
of.
|
(package private) boolean |
temp1Run2
boolean value indicating what template this fragment is currently apart
of.
|
(package private) boolean |
temp2
boolean value indicating what template this fragment is currently apart
of.
|
(package private) boolean |
temp3
boolean value indicating what template this fragment is currently apart
of.
|
(package private) SSTimer |
timer
The instance of the
SSTimer used for retrieving timing values for
this Fragment. |
(package private) int |
video_time |
(package private) boolean |
videoComplete
A boolean value indicating when the
myVideoView has finished
playing. |
(package private) boolean |
voComplete
A boolean value indicating when the
voMediaPlayer has finished
playing. |
(package private) MediaPlayer |
voMediaPlayer
The instance of voice over MediaPlayer
|
Constructor and Description |
---|
Video(SSJsonReader reader,
int run)
The constructor saves what template type this Fragment is a part of and
copies the instance of the
SSJsonReader into memory. |
Modifier and Type | Method and Description |
---|---|
void |
onAttach(Activity activity)
This class uses the onAttach method of the android life cycle to save an
instance of the activity and to implement the interface between the main
activity and this fragment activity
|
void |
onClick(View v)
Method called when user presses the
playButton . |
void |
onCompletion(MediaPlayer mp)
Controls both the voice over and video files.
|
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
This method is called by the system to inflate the layout for the Video
screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
void |
onPause()
This method suspends the video currently playing with
myVideoView |
void |
onResume()
This method resumes the video playing with
myVideoView |
Activity activity
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.VideoView myVideoView
ImageView playButton
myVideoView
uses to begin the videoSSJsonReader reader
SSJsonReader
class that reads in the dynamic
content for the application.boolean temp1Run1
boolean temp1Run2
boolean temp2
boolean temp3
SSTimer timer
SSTimer
used for retrieving timing values for
this Fragment.int video_time
boolean videoComplete
myVideoView
has finished
playing. Default value = false;boolean voComplete
voMediaPlayer
has finished
playing. Default value = false;MediaPlayer voMediaPlayer
public Video(SSJsonReader reader, int run)
SSJsonReader
into memory.reader
- The instance of the SSJsonReader
run
- The integer representation of the corresponding Template the
Fragment is a part of.public void onAttach(Activity activity)
public void onClick(View v)
playButton
. If the voice
over is complete, the video will begin. If the video is in
Template3
, the video plays as soon as the button is pressed.public void onCompletion(MediaPlayer mp)
This method changes the value within voComplete
to indicate the
voice over file has finished playing.
If the video finishes playing, this method performs appropriate actions for any of the three templates.
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
public void onDestroy()
voMediaPlayer
is released.public void onPause()
myVideoView
public void onResume()
myVideoView