| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Admin\Controllers;
- use Encore\Admin\Controllers\AdminController;
- use App\Models\Rome;
- use Encore\Admin\Grid;
- use Encore\Admin\Layout\Content;
- use Encore\Admin\Show;
- use Encore\Admin\Admin;
- use App\Api\Util\IM;
- class RoomVideoController extends AdminController
- {
- use IM;
- protected $title = '房间监控';
- // public function index(Content $content)
- // {
- // $data=[['id'=>1,'url'=>2,'name'=>'2342']];//Rome::where('end',0)->get();
- // $content->title('房间监控');
- // $content->description('房间监控');
- // $content->row();
- // $x='if (flvjs.isSupported()) { ';
- // foreach($data as $k=>$v){
- // $url=config('love.PLAY_DOMAINS').'/live/'.config('love.IM_SDKAPPID').'_r'.$v->id.'.flv';
- // $x=$x."var videoElement$k = document.getElementById('videoElement$k');
- // var flvPlayer$k = flvjs.createPlayer({type: 'flv',url: '$url'});
- // flvPlayer$k.attachMediaElement(videoElement$k);flvPlayer$k.load();flvPlayer$k.play();";
- // }
- // $x=$x.'}';
- // Admin::script(''.$x.';console.log("hello world");');
- // $grid->setView('admin.grid.card');
- // return $content
- // ->title('房间监控')
- // ->row(function($row) use ($data){
- // $row->column(12,view('vomevideo')->with(['envs'=>$data]));
- // });
- // }
- protected function grid()
- {
- $grid = new Grid(new Rome());
- $grid->column('id', __('ID'))->sortable();
- $grid->model()->where('end',0)->orderBy('id', 'desc');
- $grid->setView('vomevideo');
- return $grid;
- }
- public function store()
- {
- $id=request('id');
- $x=$this->closeGroup($id);
- Rome::where('end',0)->where('id',$id)->update(['end'=>time()]);
- admin_toastr('断流成功!!!', 'success');
- return redirect('admin/romevideo');
- }
- }
|