I'm not getting any content header, the file is download straight without even opening a windows so I'm not able to use the inspection tool, that's why I'm saying that maybe is a problem about the playlist file
the only content I'm able to play through the browser are .mp4 file and i get of course type:video/mp4
I even tired intercepting the traffic usaing burpsuite but no traffic is created at all
Try a tool like wget
with verbose mode turned on.
I get [Content-Type, application/octet-stream] but for all type of file .ts .mp4 and .m3u8, anyway I tried to change all the file type in Ignition, booth keeping video/MP2T for .ts and application/octet-stream for .m3u8 or applying application/octet-stream for both .ts and .m3u8 and still getting the same result
Then you cannot use a mounted folder. You will need to use jython doGet() script methods where you can explicitly control the content type for every response.
Also, go look at comment 15 for the correct filetype for an m3u8 playlist.
ok I will try ,in the meantime I just compressed the videos enough to be uploaded with WebDev but now the resolution is quite bad so for sure I'll give a try with jython code, thanks a lot for your time
I also went down the path of trying to send a playlist.m3u8 file to the VideoPlayer, using the suggestions above. In my WebDev Python resource, I tried setting different contentTypes and response types. I also played with the tags and segment paths in the playlist file.
I had the same result, where the Perspective player didn't recognize it. I could download the file using the WebDev URL in the browser and other players such as VLC or Windows Media Player could play it.
I ended up using ffmpeg to compress the original mp4 files and sending the full compressed version to the VideoPlayer.
I did the same, I'm going to make a script as soon as I finish some other jobs, and then I'll upload the code and maybe try again also with the playlist files with the help of a contact from Inductive team, anyway I'll upload any useful methods or code here
I created a web server using python that serve the video on localhost then from the video component i just put the exposed url
this is the python server, i also created a service to run at every boot
from flask import Flask, send_file
from os import listdir
from os.path import isfile, join
import os
from waitress import serve
app = Flask(__name__)
VIDEO_DIRECTORY = 'videos/' # Replace with your actual video directory
#get all file in the video folder
onlyfiles = [f for f in listdir(VIDEO_DIRECTORY) if isfile(join(VIDEO_DIRECTORY, f))]
@app.route('/video/<filename>')
def serve_video(filename):
#prevent traversal directory attack
filename = os.path.basename(filename)
#check that filename is compatible with available videos
if filename not in onlyfiles:
return 'Invalid file name.', 404
file_path = os.path.join(VIDEO_DIRECTORY, filename)
allowed_extensions = {'mp4'} # Adjust as needed
if '.' not in filename or filename.rsplit('.', 1)[1].lower() not in allowed_extensions:
return 'Invalid file format.', 400
return send_file(file_path, mimetype='video/mp4') # Adjust mimetype as needed
if __name__ == '__main__':
serve(app,host='0.0.0.0',port=xxxx)
then in the video component i just set as source http://0.0.0.0:xxxx/video/videoname.mp4
of course the script might need some changes based on your requirements