我想在我的网页上嵌入youtube视频并跟踪开始/停止并完成视频事件,我可以使用iframe但我使用youtube_dl提取两个网址,一个用于音频流,另一个用于视频流。但现在我无法理解我如何在网上一起玩它。抱歉我的英语很差。
youtube_dl -g <youtube-url>
音频网址
https://r2---sn-h0aupoxu-3ipe.googlevideo.com/videoplayback?expire=1452702118&initcwndbps=581250&keepalive=yes&key=yt6&sver=3&gcr=pk&source=youtube&signature=6563CECA1D5288261C481C060284DB05DC2E3527.CC500E44799AB305AD7B26B7EBC34149C1C3BFD6&upn=_AAJt6p8tCU&clen=42107678&gir=yes&ipbits=0&lmt=1449649957340911&fexp=9407190%2C9416075%2C9416126%2C9416402%2C9418200%2C9420452%2C9422596%2C9422968%2C9423662%2C9425957%2C9426472%2C9426504%2C9426719%2C9426757%2C9427016&sparams=clen%2Cdur%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&ip=202.142.170.44&mm=31&mn=sn-h0aupoxu-3ipe&id=o-AMeDYdwZd-wUxztM1nmJ3bjW98AF62WYrc8BzhZbIutN&itag=251&dur=2709.201&mime=audio%2Fwebm&requiressl=yes&ms=au&mt=1452680392&mv=m&pl=24&ratebypass=yes
视频网址
https://r2---sn-h0aupoxu-3ipe.googlevideo.com/videoplayback?id=e959362f7f7270b3&itag=136&source=youtube&requiressl=yes&gcr=pk&mn=sn-h0aupoxu-3ipe&mm=31&ms=au&mv=m&pl=24&ratebypass=yes&mime=video/mp4&gir=yes&clen=352468285&lmt=1440335051714588&dur=2709.200&signature=4CE70CF3A74F84029E9A09332D52496E74709F09.70D5812EF7CB413AF5DE2EBA445F118205E165F8&sver=3&mt=1452680392&fexp=9407190,9416075,9416126,9416402,9418200,9420452,9422596,9422968,9423662,9425957,9426472,9426504,9426719,9426757,9427016&upn=l4TRn6jSYMQ&key=dg_yt0&ip=202.142.170.44&ipbits=0&expire=1452702120&sparams=ip,ipbits,expire,id,itag,source,requiressl,gcr,mn,mm,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur
视频标签没有播放视频,但此网址与VLC播放器配合使用,但vlc播放时没有音频。
<video width="400" controls>
<source src="https://r2---sn-h0aupoxu-3ipe.googlevideo.com/videoplayback?id=e959362f7f7270b3&itag=136&source=youtube&requiressl=yes&gcr=pk&mn=sn-h0aupoxu-3ipe&mm=31&ms=au&mv=m&pl=24&ratebypass=yes&mime=video/mp4&gir=yes&clen=352468285&lmt=1440335051714588&dur=2709.200&signature=4CE70CF3A74F84029E9A09332D52496E74709F09.70D5812EF7CB413AF5DE2EBA445F118205E165F8&sver=3&mt=1452680392&fexp=9407190,9416075,9416126,9416402,9418200,9420452,9422596,9422968,9423662,9425957,9426472,9426504,9426719,9426757,9427016&upn=l4TRn6jSYMQ&key=dg_yt0&ip=202.142.170.44&ipbits=0&expire=1452702120&sparams=ip,ipbits,expire,id,itag,source,requiressl,gcr,mn,mm,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur
" type="video/mp4">
Your browser does not support HTML5 video.
</video>
JSON我得到了这些网址。
https://drive.google.com/file/d/0BxgrBOXyF8UAODRiUkQ2dzd1MTg/view?usp=sharing