Fixes Issue #2 #4
@ -59,21 +59,20 @@ class Mediasite:
|
|||||||
'playAudio': source['playAudio']}
|
'playAudio': source['playAudio']}
|
||||||
mypackage['sources'].append(mysource)
|
mypackage['sources'].append(mysource)
|
||||||
|
|
||||||
|
|
||||||
if 'slides' in data:
|
if 'slides' in data:
|
||||||
slides_path = os.path.join(base, 'slides')
|
slides_path = os.path.join(base, 'slides')
|
||||||
os.mkdir(slides_path)
|
os.mkdir(slides_path)
|
||||||
slides = []
|
slides = []
|
||||||
demux_file = os.path.join(slides_path, 'demux.txt')
|
demux_file = os.path.join(slides_path, 'demux.txt')
|
||||||
offset = timedelta(minutes=3, seconds=51, milliseconds=170).total_seconds() * 1000
|
offset = data['duration'] - int(data['slides'][-1]['duration'])
|
||||||
with open(demux_file, 'w') as f:
|
with open(demux_file, 'w') as f:
|
||||||
elapsed = 0 + int(offset)
|
|
||||||
myslide = {}
|
myslide = {}
|
||||||
f.write('ffconcat version 1.0\n')
|
f.write('ffconcat version 1.0\n')
|
||||||
for i in range(len(data['slides'])):
|
for i in range(len(data['slides'])):
|
||||||
myslide['url'] = os.path.join(slides_path, self._download(slides_path, data['slides'][i]['url'], session))
|
myslide['url'] = os.path.join(slides_path, self._download(slides_path, data['slides'][i]['url'], session))
|
||||||
if i == 0:
|
if i == 0:
|
||||||
myslide['duration'] = '{}ms'.format(elapsed + int(data['slides'][i]['duration']))
|
myslide['duration'] = '{}ms'.format(offset + int(data['slides'][i]['duration']))
|
||||||
elapsed += int(data['slides'][i]['duration'])
|
|
||||||
else:
|
else:
|
||||||
myslide['duration'] = '{}ms'.format(int(data['slides'][i]['duration']) - int(data['slides'][i-1]['duration']))
|
myslide['duration'] = '{}ms'.format(int(data['slides'][i]['duration']) - int(data['slides'][i-1]['duration']))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user