File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ A NativeScript plugin to provide the ability to play local and remote videos.
7
7
#### Platform controls used:
8
8
Android | iOS
9
9
---------- | -----------
10
- [ Android VideoView ] ( http ://developer.android.com/intl/zh-tw/ reference/android/widget/VideoView .html) | [ iOS AVPlayer] ( https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html )
10
+ [ Android MediaPlayer ] ( https ://developer.android.com/reference/android/media/MediaPlayer .html) | [ iOS AVPlayer] ( https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html )
11
11
12
12
13
13
## Sample Usage
@@ -81,6 +81,10 @@ Mutes the native video player.
81
81
82
82
Sets the native video player to loop once playback has finished.
83
83
84
+ - ** aspect - (boolean)** - * optional* ** ANDROID ONLY**
85
+
86
+ Defaults to true. If set to false, the aspect ratio of the video will not be honored and it will fill the entire container available.Ï
87
+
84
88
- ** loadingComplete - (function)** - * optional* ** ANDROID ONLY**
85
89
86
90
Attribute to specify an event callback to execute when the video has loaded.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-videoplayer" ,
3
- "version" : " 1.1.6 " ,
3
+ "version" : " 2.0.0 " ,
4
4
"main" : " videoplayer.js" ,
5
5
"typings" : " videoplayer.d.ts" ,
6
6
"description" : " A NativeScript plugin that uses the native video players to play local and remote videos." ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ var AUTOPLAY = "autoplay";
17
17
var CONTROLS = "controls" ;
18
18
var LOOP = "loop" ;
19
19
var MUTED = "muted" ;
20
+ var ASPECT = "aspect" ;
20
21
21
22
// on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call).
22
23
var AffectsLayout = platform . device . os === platform . platformNames . android ? dependencyObservable . PropertyMetadataSettings . None : dependencyObservable . PropertyMetadataSettings . AffectsLayout ;
@@ -96,6 +97,11 @@ export class Video extends view.View {
96
97
VIDEO ,
97
98
new proxy . PropertyMetadata ( false , dependencyObservable . PropertyMetadataSettings . None )
98
99
) ;
100
+ public static aspectProperty = new dependencyObservable . Property (
101
+ ASPECT ,
102
+ VIDEO ,
103
+ new proxy . PropertyMetadata ( false , dependencyObservable . PropertyMetadataSettings . None )
104
+ ) ;
99
105
100
106
constructor ( ) {
101
107
super ( ) ;
@@ -147,6 +153,14 @@ export class Video extends view.View {
147
153
this . _setValue ( Video . mutedProperty , value ) ;
148
154
}
149
155
156
+ get aspect ( ) : any {
157
+ return this . _getValue ( Video . aspectProperty ) ;
158
+ }
159
+ set aspect ( value : any ) {
160
+ this . _setValue ( Video . aspectProperty , value ) ;
161
+ }
162
+
163
+
150
164
public _setNativeVideo ( nativeVideo : any ) {
151
165
//
152
166
}
You can’t perform that action at this time.
0 commit comments