Closed mqbui1 closed 7 years ago
You can't do it directly. This is totally doable though. You have to expose your files through a static HTTP server and cast your files URLs.
python -m SimpleHTTPServer
const media_mp3 = {
contentId: http://$LOCAL_IP:8000/local_audio_file.mp3 ,
contentType: 'audio/mp3' ,
streamType: 'BUFFERED' ,
};
#!/bin/bash
# ps aux | grep 8000 | tail -1 | awk '{print $2}'
PreviousPID=$(ps aux | grep SimpleHTTPServer | tail -1 | awk '{print $2}')
kill -9 $PreviousPID
python -m SimpleHTTPServer 8000 &
DirectM3U8URL=`youtube-dl -f 'audio_only' -g $1`
# https://github.com/ytdl-org/youtube-dl/issues/18813#issuecomment-453766299
echo $DirectM3U8URL
ffmpeg -i "$DirectM3U8URL" local_audio_file.mp3 -y
./above_script.sh https://twitch.tv/lost_in_house
And then Use:
const media_mp3 = {
contentId: http://$LOCAL_IP:8000/local_audio_file.mp3 ,
contentType: 'audio/mp3' ,
streamType: 'BUFFERED' ,
};
It plays , but you have to keep restarting it after it reaches the end of the mp3.
Is there a way to playback videos that is installed locally? For example, I want to be able to cast all the videos in a directory on my raspberry pi.
Any help is appreciated, thanks.