另一个九天航模社
存在于Terra之上的另一个九天航模社
  • Home
  • Nichijou
  • Nijigen

用PHP搭建弹幕播放器后台

12/9/2013

0 Comments

 
弹幕播放器的后台搭建其实比较简单,了解了Mukioplayer的原理之后就很容易设计出接受和发送弹幕的php页面。
MukioPlayer是通过播放器同路径的conf.xml文件来读取弹幕文件的地址和发送弹幕的地址的。
于是可以分别新建两个页面getcomment.php和postcomment.php。
getcomment.php接受一个vid参数,用于获取对应视频的弹幕。
用全局变量$_GET['vid']来获得提交的vid,于是conf.xml里的<load>字段就应该写成
getcomment.php?vid={$id}的形式,播放器会根据flashvars里的vid参数自动将{$id}替换成对应的数字
而postcomment.php则是用$_POST全局变量来获得播放器post的表单,
其中user字段一直都是test,可以暂时忽略。stime是视频时间,size弹幕大小,mode弹幕类型(滚动,上方,下方),color是颜色,time是时间戳,message则是弹幕内容。
0 Comments



Leave a Reply.

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    March 2014
    January 2014
    December 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.