Skip to content

Commit

Permalink
[TIMOB-23452] Clean deprecated API's from Ti.Media
Browse files Browse the repository at this point in the history
and Ti.FIlesystem
  • Loading branch information
hansemannn committed May 28, 2016
1 parent c5b0aec commit 010a020
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 175 deletions.
6 changes: 3 additions & 3 deletions apidoc/Titanium/Media/AudioPlayer.yml
Expand Up @@ -327,9 +327,9 @@ properties:
On iOS, to adjust the volume of the device, set the `volume` property of
<Titanium.Media.appMusicPlayer> and set the <Titanium.Media.audioSessionMode> property
to either <Titanium.Media.AUDIO_SESSION_MODE_AMBIENT>,
<Titanium.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT>,
or <Titanium.Media.AUDIO_SESSION_MODE_PLAYBACK>.
to either <Titanium.Media.AUDIO_SESSION_CATEGORY_AMBIENT>,
<Titanium.Media.AUDIO_SESSION_CATEGORY_SOLO_AMBIENT>,
or <Titanium.Media.AUDIO_SESSION_CATEGORY_PLAYBACK>.
type: Number
since: "2.1.0"
- name: waiting
Expand Down
9 changes: 5 additions & 4 deletions apidoc/Titanium/Media/Media.yml
Expand Up @@ -107,9 +107,9 @@ methods:
since:
android: "3.3.0"
- name: setOverrideAudioRoute
summary: Overrides the default audio route when using the <Titanium.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD> session mode.
summary: Overrides the default audio route when using the <Titanium.Media.AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD> session mode.
description: |
By default, when using the <Titanium.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD> session mode,
By default, when using the <Titanium.Media.AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD> session mode,
the audio output is routed to the speaker in the receiver. This method lets you specify
that audio should be routed to the built-in speaker.
Expand Down Expand Up @@ -563,7 +563,7 @@ properties:
This category is appropriate for simultaneous recording and playback, and also for
applications that record and play back but not simultaneously. If you want to ensure
that sounds such as Messages alerts do not play while your application is recording,
use <Titanium.Media.AUDIO_SESSION_MODE_RECORD> instead. This category normally
use <Titanium.Media.AUDIO_SESSION_CATEGORY_RECORD> instead. This category normally
disallows mixing iPod audio with application audio.
In this mode, by default audio playback is routed to the speaker in the iPhone receiver. To have audio playback through the iPhone speaker, use <Titanium.Media.setOverrideAudioRoute>.
Expand All @@ -574,7 +574,7 @@ properties:
- name: AUDIO_SESSION_MODE_RECORD
deprecated:
since: "3.4.2"
notes: Deprecated in favor of the `AUDIO_SESSION_CATEGORY` constants defined in <Titanium.Media>.
notes: Deprecated in favor of the `AUDIO_SESSION_CATEGORY_*` constants defined in <Titanium.Media>.
removed: "6.0.0"
summary: Session mode for recording audio; it silences playback audio.
type: Number
Expand Down Expand Up @@ -1270,6 +1270,7 @@ properties:
- name: audioSessionMode
deprecated:
since: "3.4.2"
removed: "6.0.0"
notes: Deprecated in favor of the Titanium.Media.audioSessionCategory property.
summary: A constant for the audio session mode to be used.
description: |
Expand Down
6 changes: 3 additions & 3 deletions apidoc/Titanium/Media/Sound.yml
Expand Up @@ -292,9 +292,9 @@ properties:
On iOS, to adjust the volume of the device, set the `volume` property of
<Titanium.Media.appMusicPlayer> and set the <Titanium.Media.audioSessionMode> property
to either <Titanium.Media.AUDIO_SESSION_MODE_AMBIENT>,
<Titanium.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT>,
or <Titanium.Media.AUDIO_SESSION_MODE_PLAYBACK>.
to either <Titanium.Media.AUDIO_SESSION_CATEGORY_SOLO_AMBIENT>,
<Titanium.Media.AUDIO_SESSION_CATEGORY_PLAYBACK>,
or <Titanium.Media.AUDIO_SESSION_CATEGORY_PLAYBACK>.
type: Number

examples:
Expand Down
98 changes: 37 additions & 61 deletions apidoc/Titanium/Media/VideoPlayer.yml
Expand Up @@ -115,7 +115,7 @@ examples:
var activeMovie = Titanium.Media.createVideoPlayer({
url : contentURL,
backgroundColor : 'blue',
movieControlMode : Titanium.Media.VIDEO_CONTROL_DEFAULT,
mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL,
fullscreen : true,
autoplay : true
Expand Down Expand Up @@ -201,43 +201,6 @@ methods:
summary: Callback to invoke when a thumbnail is available.
type: Callback<ThumbnailResponse>

- name: setBackgroundView
summary: Sets the background view for customization which is always displayed behind movie content.
description: |
To create a background behind the movie content on iOS, you can specify a
background view. On iOS, you can set the `backgroundColor` property directly on
the video player, but not a background image or background gradient. For this kind
of effect, specify a background view.
Note that the background view must be sized explicitly: percentage sizes do not work properly.
The following code sample creates a video player with a background image:
var videoPlayer = Titanium.Media.createVideoPlayer({
height : 300,
width : 300,
backgroundView : Ti.UI.createView({
backgroundImage: 'videoPlayerBG.png
width : 300,
height : 300
})
borderRadius : 20,
borderWidth : 2,
borderColor : 'blue',
});
Note that if [scalingMode](Titanium.Media.VideoPlayer.scalingMode) is set to
[VIDEO_SCALING_MODE_FILL](Titanium.Media.VIDEO_SCALING_MODE_FILL) or
[VIDEO_SCALING_ASPECT_FILL](Titanium.Media.VIDEO_SCALING_ASPECT_FILL),
the playing video will fill the entire video player area, obscuring any background
view.
platforms: [iphone, ipad]
parameters:

- name: view
summary: View to set.
type: Titanium.UI.View

- name: stop
summary: Stops playing the video.

Expand Down Expand Up @@ -306,7 +269,6 @@ events:
summary: Video duration, in milliseconds.
type: Number


- name: durationavailable
summary: Fired when the video duration is available.
properties:
Expand All @@ -315,7 +277,6 @@ events:
type: Number
since: '3.0.0'


- name: error
summary: Fired when movie playback encounters an error.
properties:
Expand All @@ -324,17 +285,14 @@ events:
type: String
deprecated:
since: "3.1.0"

- name: success
summary: Indicates a successful operation. Returns `false`.
type: Boolean
platforms: [android]

- name: error
summary: Error message, if any returned. May be undefined.
type: String
platforms: [android]

platforms: [android]
- name: code
summary: |
Error code.
Expand All @@ -344,8 +302,6 @@ events:
platforms: [android]
platforms: [android, mobileweb]



- name: fullscreen
summary: Fired when a movie changes to or from fullscreen view.
description: |
Expand Down Expand Up @@ -421,7 +377,6 @@ events:
type: Number
constants: Titanium.Media.VIDEO_PLAYBACK_STATE_*


- name: mediatypesavailable
summary: Fired when the media types in the current movie are determined.
platforms: [iphone, ipad]
Expand Down Expand Up @@ -452,7 +407,6 @@ events:
constants: Titanium.Media.VIDEO_PLAYBACK_STATE_*
since: '3.0.0'


- name: playing
summary: Fired when the currently playing movie changes.
platforms: [android, iphone, ipad, mobileweb]
Expand Down Expand Up @@ -586,7 +540,42 @@ properties:
conditions (if the movie is being streamed from a remote source).
type: Boolean
default: true

- name: backgroundView
summary: Sets the background view for customization which is always displayed behind movie content.
description: |
To create a background behind the movie content on iOS, you can specify a
background view. On iOS, you can set the `backgroundColor` property directly on
the video player, but not a background image or background gradient. For this kind
of effect, specify a background view.
Note that the background view must be sized explicitly: percentage sizes do not work properly.
The following code sample creates a video player with a background image:
var videoPlayer = Ti.Media.createVideoPlayer({
height : 300,
width : 300,
backgroundView : Ti.UI.createView({
backgroundImage: 'videoPlayerBG.png
width : 300,
height : 300
}),
borderRadius : 20,
borderWidth : 2,
borderColor : 'blue',
});
Note that if [scalingMode](Titanium.Media.VideoPlayer.scalingMode) is set to
[VIDEO_SCALING_MODE_FILL](Titanium.Media.VIDEO_SCALING_MODE_FILL) or
[VIDEO_SCALING_ASPECT_FILL](Titanium.Media.VIDEO_SCALING_ASPECT_FILL),
the playing video will fill the entire video player area, obscuring any background
view.
platforms: [iphone, ipad]
parameters:
- name: view
summary: View to set.
type: Titanium.UI.View

- name: contentURL
summary: URL of the media to play.
Expand All @@ -596,12 +585,10 @@ properties:
notes: Use the [url](Titanium.Media.VideoPlayer.url) property instead.
type: String


- name: currentPlaybackTime
summary: Current playback time of the current movie in milliseconds.
type: Number


- name: duration
summary: The duration of the current movie in milliseconds, or 0.0 if not known.
description: |
Expand All @@ -610,7 +597,6 @@ properties:
fired when the duration is known.
type: Number


- name: endPlaybackTime
summary: The end time of movie playback, in milliseconds.
description: |
Expand All @@ -623,7 +609,6 @@ properties:
(the natural end time), and changing the value has no effect.
type: Number


- name: fullscreen
summary: |
Determines if the movie is presented in the entire screen (obscuring all other application content).
Expand All @@ -642,27 +627,23 @@ properties:
type: Boolean
default: false


- name: initialPlaybackTime
summary: The start time of movie playback, in milliseconds.
description: |
Defaults to NaN in iOS and 0 in Android, indicating the natural start time of the movie.
type: Number


- name: loadState
summary: Returns the network load state of the movie player.
type: Number
permission: read-only


- name: media
summary: Media object to play, as either a `File`, a `Blob`, or a URL.
platforms: [iphone, ipad]
type: [Titanium.Blob, Titanium.Filesystem.File, String]
permission: write-only


- name: mediaControlStyle
summary: The style of the playback controls.
description: |
Expand All @@ -672,7 +653,6 @@ properties:
constants: Titanium.Media.VIDEO_CONTROL_*
default: System default video controls (<Titanium.Media.VIDEO_CONTROL_DEFAULT>).


- name: mediaTypes
summary: The types of media in the movie, or <Titanium.Media.VIDEO_MEDIA_TYPE_NONE> if not known.
description: |
Expand Down Expand Up @@ -714,7 +694,6 @@ properties:
platforms: [iphone, ipad]
type: MovieSize


- name: playableDuration
summary: |
Currently playable duration of the movie, in milliseconds, for progressively
Expand All @@ -733,7 +712,6 @@ properties:
constants: Titanium.Media.VIDEO_PLAYBACK_STATE_*
permission: read-only


- name: playing
summary: Boolean to indicate if the player has started playing.
type: Boolean
Expand All @@ -746,7 +724,6 @@ properties:
constants: Titanium.Media.VIDEO_REPEAT_MODE_*
default: Titanium.Media.VIDEO_REPEAT_MODE_NONE


- name: scalingMode
summary: Determines how the content scales to fit the view.
description: |
Expand All @@ -756,7 +733,6 @@ properties:
constants: Titanium.Media.VIDEO_SCALING_*
default: <Titanium.Media.VIDEO_SCALING_ASPECT_FIT>


- name: sourceType
summary: The playback type of the movie.
description: |
Expand Down
8 changes: 0 additions & 8 deletions iphone/Classes/MediaModule.h
Expand Up @@ -73,9 +73,7 @@
@property(nonatomic,readonly) NSNumber* NO_VIDEO;
@property(nonatomic,readonly) NSNumber* NO_MUSIC_PLAYER;

// these have been deprecated in 3.2 but we map them to their new values
@property(nonatomic,readonly) NSNumber* VIDEO_CONTROL_DEFAULT;
@property(nonatomic,readonly) NSNumber* VIDEO_CONTROL_VOLUME_ONLY;
@property(nonatomic,readonly) NSNumber* VIDEO_CONTROL_HIDDEN;

@property(nonatomic,readonly) NSNumber* VIDEO_SCALING_NONE;
Expand Down Expand Up @@ -127,12 +125,6 @@
@property(nonatomic,readonly) NSNumber* AUDIO_FILEFORMAT_3GP2;
@property(nonatomic,readonly) NSNumber* AUDIO_FILEFORMAT_AMR;

@property(nonatomic,readonly) NSNumber* AUDIO_SESSION_MODE_AMBIENT;
@property(nonatomic,readonly) NSNumber* AUDIO_SESSION_MODE_SOLO_AMBIENT;
@property(nonatomic,readonly) NSNumber* AUDIO_SESSION_MODE_PLAYBACK;
@property(nonatomic,readonly) NSNumber* AUDIO_SESSION_MODE_RECORD;
@property(nonatomic,readonly) NSNumber* AUDIO_SESSION_MODE_PLAY_AND_RECORD;

@property(nonatomic,readonly) NSString* AUDIO_SESSION_CATEGORY_AMBIENT;
@property(nonatomic,readonly) NSString* AUDIO_SESSION_CATEGORY_SOLO_AMBIENT;
@property(nonatomic,readonly) NSString* AUDIO_SESSION_CATEGORY_PLAYBACK;
Expand Down

0 comments on commit 010a020

Please sign in to comment.