Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-19040] :Replace MPMoviePlayerController in Ti.Media.VideoPlayer with AVPlayerViewController #9600

Merged
merged 6 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
91 changes: 91 additions & 0 deletions apidoc/Titanium/Media/Media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,10 @@ properties:
type: Number
permission: read-only
- name: VIDEO_CONTROL_DEFAULT
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Constant for default video controls.
description: |
Used in conjunction with the
Expand All @@ -1185,6 +1189,10 @@ properties:
type: Number
permission: read-only
- name: VIDEO_CONTROL_EMBEDDED
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Constant for video controls for an embedded view.
description: |
Used in conjunction with the
Expand All @@ -1197,6 +1205,10 @@ properties:
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_CONTROL_FULLSCREEN
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Constant for fullscreen video controls.
description: |
Used in conjunction with the
Expand Down Expand Up @@ -1266,17 +1278,30 @@ properties:
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_LOAD_STATE_FAILED
summary: Indicates that the player can no longer play media items because of an error.
type: Number
permission: read-only
platforms: [iphone, ipad]
- name: VIDEO_LOAD_STATE_PLAYABLE
summary: Current media is playable.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_LOAD_STATE_PLAYTHROUGH_OK
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Playback will be automatically started in this state when `autoplay` is true.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_LOAD_STATE_STALLED
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Playback will be automatically paused in this state, if started.
type: Number
permission: read-only
Expand All @@ -1287,16 +1312,28 @@ properties:
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_MEDIA_TYPE_AUDIO
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: A audio type of media in the movie returned by <Titanium.Media.VideoPlayer> `mediaTypes` property.
type: Number
permission: read-only
platforms: [iphone, ipad]
- name: VIDEO_MEDIA_TYPE_NONE
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: An unknown type of media in the movie returned by <Titanium.Media.VideoPlayer> `mediaTypes` property.
type: Number
permission: read-only
platforms: [iphone, ipad]
- name: VIDEO_MEDIA_TYPE_VIDEO
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: A video type of media in the movie returned by <Titanium.Media.VideoPlayer> `mediaTypes` property.
type: Number
permission: read-only
Expand Down Expand Up @@ -1332,18 +1369,30 @@ properties:
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_REPEAT_MODE_NONE
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Constant for disabling repeat on video playback.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0"}
- name: VIDEO_REPEAT_MODE_ONE
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Constant for repeating one video (i.e., the one video will repeat constantly) during playback.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0"}
- name: VIDEO_SCALING_ASPECT_FILL
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Scale video to fill the screen, clipping edges if necessary.
description: |
Video is scaled until the video fills the entire screen. Content at the edges
Expand All @@ -1353,6 +1402,10 @@ properties:
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_SCALING_ASPECT_FIT
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Scale video to fit the screen, letterboxing if necessary.
description: |
Video is scaled until the larger dimension fits on the screen exactly. In the
Expand All @@ -1362,30 +1415,68 @@ properties:
permission: read-only

- name: VIDEO_SCALING_MODE_FILL
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Video is scaled until both dimensions fit the screen exactly, stretching if necessary.
description: |
The aspect ratio of the video is not preserved.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: VIDEO_SCALING_NONE
deprecated:
since: "7.0.0"
notes: This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Video scaling is disabled.
type: Number
permission: read-only
- name: VIDEO_SCALING_RESIZE
summary: Specifies that the video should be stretched to fill the bounds of layer.
type: String
permission: read-only
platforms: [iphone, ipad]
since: "7.0.0"
- name: VIDEO_SCALING_RESIZE_ASPECT
summary: Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer.
type: String
permission: read-only
platforms: [iphone, ipad]
since: "7.0.0"
- name: VIDEO_SCALING_RESIZE_ASPECT_FILL
summary: Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer.
type: String
permission: read-only
platforms: [iphone, ipad]
since: "7.0.0"

- name: VIDEO_SOURCE_TYPE_FILE
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Video source type is a file.
description: Related to the `sourceType` property of <Titanium.Media.VideoPlayer>.
type: Number
permission: read-only
platforms: [iphone, ipad]
- name: VIDEO_SOURCE_TYPE_STREAMING
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Video source type is a remote stream.
description: Related to the `sourceType` property of <Titanium.Media.VideoPlayer>
type: Number
permission: read-only
platforms: [iphone, ipad]
- name: VIDEO_SOURCE_TYPE_UNKNOWN
deprecated:
since: "7.0.0"
notes: This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Video source type is unknown.
description: Related to the `sourceType` property of <Titanium.Media.VideoPlayer>
type: Number
Expand Down
87 changes: 85 additions & 2 deletions apidoc/Titanium/Media/VideoPlayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ events:
platforms: [android]

- name: fullscreen
deprecated:
since: "7.0.0"
notes: This event has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Fired when a movie changes to or from fullscreen view.
description: |
On iOS, this event is fired at the beginning of the transition to
Expand Down Expand Up @@ -374,6 +378,10 @@ events:
constants: Titanium.Media.VIDEO_PLAYBACK_STATE_*

- name: mediatypesavailable
deprecated:
since: "7.0.0"
notes: This event has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Fired when the media types in the current movie are determined.
platforms: [iphone, ipad]
properties:
Expand Down Expand Up @@ -432,6 +440,10 @@ events:
summary: New `sourceType` value.

- name: sourcechange
deprecated:
since: "7.0.0"
notes: This event has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: |
Fired when the [sourceType](Titanium.Media.VideoPlayer.sourceType) property
changes.
Expand Down Expand Up @@ -536,6 +548,9 @@ properties:
default: true

- name: backgroundView
deprecated:
since: "7.0.0"
notes: Use <Titanium.Media.VideoPlayer.overlayView> instead.
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
Expand Down Expand Up @@ -601,6 +616,10 @@ properties:
type: Number

- name: fullscreen
deprecated:
since: "7.0.0"
notes: This method has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: |
Determines if the movie is presented in the entire screen (obscuring all other application content).
description: |
Expand All @@ -625,6 +644,9 @@ properties:
type: Number

- name: loadState
deprecated:
since: "7.0.0"
notes: On iOS, use <Titanium.Media.VideoPlayer.moviePlayerStatus> instead.
summary: Returns the network load state of the movie player.
type: Number
permission: read-only
Expand All @@ -636,6 +658,10 @@ properties:
permission: write-only

- name: mediaControlStyle
deprecated:
since: "7.0.0"
notes: On iOS, use <Titanium.Media.VideoPlayer.showsControls> instead.
removed: "7.0.0"
summary: The style of the playback controls.
description: |
Mobile web only supports <Titanium.Media.VIDEO_CONTROL_NONE> and
Expand Down Expand Up @@ -674,6 +700,12 @@ properties:
ios:
max: "3.1"

- name: moviePlayerStatus
summary: Returns the status of the movie player.
type: Number
permission: read-only
platforms: [iphone, ipad]

- name: naturalSize
summary: Returns the natural size of the movie.
description: |
Expand All @@ -685,6 +717,37 @@ properties:
platforms: [iphone, ipad]
type: MovieSize

- name: overlayView
summary: Use the overlay view to add additional custom views between the video content and the controls.
description: |
Note that the overlay 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,
overlayView : Ti.UI.createView({
backgroundImage: 'videoPlayerBG.png
width : 300,
height : 300
}),
borderRadius : 20,
borderWidth : 2,
borderColor : 'blue',
});
platforms: [iphone, ipad]
type: Titanium.UI.View

- name: pictureInPictureEnabled
summary: Whether or not the receiver allows Picture in Picture playback
platforms: [iphone, ipad]
type: Boolean
default: true
osver:
ios:
max: "9.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering how this passes linting. Some notes:

  • It should be "min", not "max", because it was introduced in iOS 9
  • The syntax is osver: {ios: {min: "9.0"}}
  • Add a . after playback


- name: playableDuration
summary: |
Currently playable duration of the movie, in milliseconds, for progressively
Expand All @@ -709,8 +772,13 @@ properties:
permission: read-only

- name: repeatMode
summary: Determines how the movie player repeats when reaching the end of playback.
deprecated:
since: "7.0.0"
notes: This method has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
removed: "7.0.0"
summary: Determines how the movie player repeats when reaching the end of playback.
platforms: [android, iphone, ipad]

type: Number
constants: Titanium.Media.VIDEO_REPEAT_MODE_*
default: Titanium.Media.VIDEO_REPEAT_MODE_NONE
Expand All @@ -725,8 +793,23 @@ properties:
constants: Titanium.Media.VIDEO_SCALING_*
default: <Titanium.Media.VIDEO_SCALING_ASPECT_FIT>

- name: showsControls
summary: Whether or not the receiver shows playback controls. Default is YES.
description: |
Clients can set this property to NO when they don't want to have any playback controls on top of
the visual content (e.g. for a game splash screen). This property should not be used to temporarily
change the visibility of the playback controls since it will create or destroy UI elements.
platforms: [iphone, ipad]
type: Boolean
default: true
since: "7.0.0"

- name: sourceType
summary: The playback type of the movie.
deprecated:
since: "7.0.0"
notes: This method has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add: The source type is detected automatically in the newer Apple API's used. Full:

notes: |
    This method has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.
    The source type is detected automatically in the newer Apple API's used.

removed: "7.0.0"
summary: The playback type of the movie.
description: |
Specifying a playback type before playing the movie can result in faster load times.

Expand Down