File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
test/java/com/cloudinary/test Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,24 @@ public T gravity(String value) {
121121 return param ("gravity" , value );
122122 }
123123
124+ /**
125+ * Set the keyframe interval parameter
126+ * @param value Interval in seconds
127+ * @return The transformation for chaining
128+ */
129+ public T keyframeInterval (float value ) {
130+ return param ("keyframe_interval" , value );
131+ }
132+
133+ /**
134+ * Set the keyframe interval parameter
135+ * @param value Interval in seconds.
136+ * @return The transformation for chaining
137+ */
138+ public T keyframeInterval (String value ) {
139+ return param ("keyframe_interval" , value );
140+ }
141+
124142 public T colorSpace (String value ) {
125143 return param ("color_space" , value );
126144 }
@@ -623,7 +641,8 @@ public String generate(Map options) {
623641 "pg" , "page" ,
624642 "u" , "underlay" ,
625643 "vs" , "video_sampling" ,
626- "sp" , "streaming_profile"
644+ "sp" , "streaming_profile" ,
645+ "ki" , "keyframe_interval"
627646 };
628647
629648 for (int i = 0 ; i < simple_params .length ; i += 2 ) {
Original file line number Diff line number Diff line change @@ -1084,6 +1084,17 @@ public void testFps() {
10841084
10851085 }
10861086
1087+ @ Test
1088+ public void testKeyframeInterval (){
1089+ assertEquals ("ki_10.0" , new Transformation ().keyframeInterval (10 ).generate ());
1090+ assertEquals ("ki_0.05" , new Transformation ().keyframeInterval (0.05f ).generate ());
1091+ assertEquals ("ki_3.45" , new Transformation ().keyframeInterval (3.45f ).generate ());
1092+ assertEquals ("ki_300.0" , new Transformation ().keyframeInterval (300 ).generate ());
1093+ assertEquals ("ki_10" , new Transformation ().keyframeInterval ("10" ).generate ());
1094+ assertEquals ("" , new Transformation ().keyframeInterval ("" ).generate ());
1095+ assertEquals ("" , new Transformation ().keyframeInterval (null ).generate ());
1096+ }
1097+
10871098 public static Map <String , String > getUrlParameters (URI uri ) throws UnsupportedEncodingException {
10881099 Map <String , String > params = new HashMap <String , String >();
10891100 for (String param : uri .getRawQuery ().split ("&" )) {
You can’t perform that action at this time.
0 commit comments