@@ -297,17 +297,16 @@ def __init__(self, *args, **kwargs):
297
297
kwargs ['resource_name' ] = 'jobs'
298
298
super (Job , self ).__init__ (* args , ** kwargs )
299
299
300
- def create (self , input , outputs = None , options = None ):
300
+ def create (self , input = None , live_stream = False , outputs = None , options = None ):
301
301
"""
302
- Creates a job
302
+ Creates a transcoding job.
303
303
304
304
@param input: the input url as string
305
+ @param live_stream: starts an RTMP Live Stream
305
306
@param outputs: a list of output dictionaries
306
307
@param options: a dictionary of job options
307
308
"""
308
- as_test = int (self .test )
309
-
310
- data = {"input" : input , "test" : as_test }
309
+ data = {"input" : input , "test" : self .test }
311
310
if outputs :
312
311
data ['outputs' ] = outputs
313
312
@@ -364,6 +363,10 @@ def delete(self, job_id):
364
363
"""
365
364
return self .cancel (job_id )
366
365
366
+ def finish (self , job_id ):
367
+ """ Finishes the live stream for `job_id`. """
368
+ return self .put (self .base_url + '/%s/finish' % str (job_id ))
369
+
367
370
class Report (HTTPBackend ):
368
371
def __init__ (self , * args , ** kwargs ):
369
372
"""
@@ -404,3 +407,4 @@ def minutes(self, start_date=None, end_date=None, grouping=None):
404
407
405
408
url = self .base_url + '/minutes'
406
409
return self .get (url , data = data )
410
+
0 commit comments