Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (68414 Members, 793 Products, 5353 Topic, 13045 Comments)

Cara upload video sendiri tanpa youtube di Swarakalibata V.8.0

Dibuat
Login Terakhir 2 Bulan lalu,
Telah Dilihat 989 Kali
Sugandi Anarki Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. admin saya mau tanya, bagaimana cara menambahkan form upload video sendiri..?
  4. saya bermaksud ini mengupload video pribadi untuk perkumpulan tanpa melalui youtube terlebih dahulu pada aplikasi swarakalibata v.8.0 ini admin.
  5.  
  6. mohon maaf sebelumnya,
  7. saya ucapkan banyak terima kasih.

Ada 7 Jawaban

Bukhori Muslim
commented on 11 Des 2019 07:59:33
Salah satu jawaban terbaik,..
  1. Assalamualaikum,.. caranya sama dengan upload foto pada gallery,
  2. sebenarnya bisa comot saja script upload di gallery,
  3.  
  4. tambahkan inputannya (application/views/administrator/mod_video/view_video_tambah.php) :
  5. <tr><th scope='row'>File Video</th> <td><input type='file' class='form-control' name='video'></td></tr>
  6.  
  7. Lalu pada Controllers tambahkan bari ini pada function tambah_video() dan edit_video :
  8. $this->upload->do_upload('video');
  9. $hasil_video=$this->upload->data();
  10.  
  11. lalu pada querynya tinggal kondisikan sekali lagi
  12. didalam if ($hasil['file_name']==''){ jadinya seperti ini nanti kondisinya :
  13.  
  14. if ($hasil['file_name']==''){
  15. if ($hasil_video['file_name']==''){
  16. 'video'=>'',
  17. }else{
  18. 'video'=>$hasil_video['file_name'],
  19. }
  20. }else{
  21.  
  22. }
Sugandi Anarki
commented on 11 Des 2019 19:55:53
  1. Assalamualaikum,.. maaf sebelumnya gan, saya mendapat kendala dalam penginputan
  2.  
  3.  
  4. function tambah_video(){
  5. cek_session_akses('video',$this->session->id_session);
  6. if (isset($_POST['submit'])){
  7. $config['upload_path'] = 'asset/img_video/';
  8. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
  9. $config['max_size'] = ''; // kb
  10. $this->load->library('upload', $config);
  11. $this->upload->do_upload('d');
  12. $hasil=$this->upload->data();
  13. $this->upload->do_upload('video');
  14. $hasil=$this->upload->data();
  15. if ($this->input->post('f')!=''){
  16. $tag_seo = $this->input->post('f');
  17. $tag=implode(',',$tag_seo);
  18. }else{
  19. $tag = '';
  20. }
  21.  
  22. if ($hasil['file_name']==''){
  23. if ($hasil_video['file_name']=='')
  24.  
  25.  
  26.  
  27. $data = array('id_playlist'=>$this->input->post('a'),
  28. 'username'=>$this->session->username,
  29. 'jdl_video'=>$this->input->post('b'),
  30. 'video_seo'=>seo_title($this->input->post('b')),
  31. 'keterangan'=>$this->input->post('c'),
  32. 'video'=>'',
  33. 'youtube'=>$this->input->post('e'),
  34. 'dilihat'=>'0',
  35. 'hari'=>hari_ini(date('w')),
  36. 'tanggal'=>date('Y-m-d'),
  37. 'jam'=>date('H:i:s'),
  38. 'tagvid'=>$tag);
  39. }else{
  40. $data = array('id_playlist'=>$this->input->post('a'),
  41. 'username'=>$this->session->username,
  42. 'jdl_video'=>$this->input->post('b'),
  43. 'video_seo'=>seo_title($this->input->post('b')),
  44. 'keterangan'=>$this->input->post('c'),
  45. 'gbr_video'=>$hasil['file_name'],
  46. 'video'=>$hasil_video['file_name'],
  47. 'youtube'=>$this->input->post('e'),
  48. 'dilihat'=>'0',
  49. 'hari'=>hari_ini(date('w')),
  50. 'tanggal'=>date('Y-m-d'),
  51. 'jam'=>date('H:i:s'),
  52. 'tagvid'=>$tag);
  53. }
  54. $this->model_app->insert('video',$data);
  55. redirect($this->uri->segment(1).'/video');
  56. }else{
  57. $data['record'] = $this->model_app->view_ordering('playlist','id_playlist','DESC');
  58. $data['tag'] = $this->model_app->view_ordering('tagvid','id_tag','DESC');
  59. $this->template->load('administrator/template','administrator/mod_video/view_video_tambah',$data);
  60. }
  61. }
  62.  
  63. function edit_video(){
  64. cek_session_akses('video',$this->session->id_session);
  65. $id = $this->uri->segment(3);
  66. if (isset($_POST['submit'])){
  67. $config['upload_path'] = 'asset/img_video/';
  68. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
  69. $config['max_size'] = '3000'; // kb
  70. $this->load->library('upload', $config);
  71. $this->upload->do_upload('d');
  72. $hasil=$this->upload->data();
  73. $this->upload->do_upload('video');
  74. $hasil_video=$this->upload->data();
  75. if ($this->input->post('f')!=''){
  76. $tag_seo = $this->input->post('f');
  77. $tag=implode(',',$tag_seo);
  78. }else{
  79. $tag = '';
  80. }
  81.  
  82. if ($hasil['file_name']==''){
  83. $data = array('id_playlist'=>$this->input->post('a'),
  84. 'username'=>$this->session->username,
  85. 'jdl_video'=>$this->input->post('b'),
  86. 'video_seo'=>seo_title($this->input->post('b')),
  87. 'keterangan'=>$this->input->post('c'),
  88. 'video'=>'',
  89. 'youtube'=>$this->input->post('e'),
  90. 'tagvid'=>$tag);
  91. }else{
  92. $data = array('id_playlist'=>$this->input->post('a'),
  93. 'username'=>$this->session->username,
  94. 'jdl_video'=>$this->input->post('b'),
  95. 'video_seo'=>seo_title($this->input->post('b')),
  96. 'keterangan'=>$this->input->post('c'),
  97. 'gbr_video'=>$hasil['file_name'],
  98. 'video'=>'',
  99. 'youtube'=>$this->input->post('e'),
  100. 'tagvid'=>$tag);
  101. }
  102.  
  103.  
  104.  
Bukhori Muslim
commented on 12 Des 2019 07:39:52
  1. Assalamualaikum,.. yahhh pastinya error lah jika bikinnya seperti diatas gan,
  2. saya sudah contohkan pada komentar diatas bikinnya begini :
  3. if ($hasil['file_name']==''){
  4. if ($hasil_video['file_name']==''){
  5. 'video'=>'',
  6. }else{
  7. 'video'=>$hasil_video['file_name'],
  8. }
  9. }else{
  10.  
  11. }
  12.  
  13. kalau diisi querynya jadinya seperti ini yang benar :
  14. function tambah_video(){
  15. cek_session_akses('video',$this->session->id_session);
  16. if (isset($_POST['submit'])){
  17. $config['upload_path'] = 'asset/img_video/';
  18. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG|mp4|MP4';
  19. $config['max_size'] = '3000'; // kb
  20. $this->load->library('upload', $config);
  21. $this->upload->do_upload('d');
  22. $hasil=$this->upload->data();
  23.  
  24. $this->upload->do_upload('video');
  25. $hasil_video=$this->upload->data();
  26.  
  27. if ($this->input->post('f')!=''){
  28. $tag_seo = $this->input->post('f');
  29. $tag=implode(',',$tag_seo);
  30. }else{
  31. $tag = '';
  32. }
  33.  
  34. if ($hasil['file_name']==''){
  35. if ($hasil_video['file_name']==''){
  36. $data = array('id_playlist'=>$this->input->post('a'),
  37. 'username'=>$this->session->username,
  38. 'jdl_video'=>$this->input->post('b'),
  39. 'video_seo'=>seo_title($this->input->post('b')),
  40. 'keterangan'=>$this->input->post('c'),
  41. 'video'=>'',
  42. 'youtube'=>$this->input->post('e'),
  43. 'dilihat'=>'0',
  44. 'hari'=>hari_ini(date('w')),
  45. 'tanggal'=>date('Y-m-d'),
  46. 'jam'=>date('H:i:s'),
  47. 'tagvid'=>$tag);
  48. }else{
  49. $data = array('id_playlist'=>$this->input->post('a'),
  50. 'username'=>$this->session->username,
  51. 'jdl_video'=>$this->input->post('b'),
  52. 'video_seo'=>seo_title($this->input->post('b')),
  53. 'keterangan'=>$this->input->post('c'),
  54. 'video'=>$hasil_video['file_name'],
  55. 'youtube'=>$this->input->post('e'),
  56. 'dilihat'=>'0',
  57. 'hari'=>hari_ini(date('w')),
  58. 'tanggal'=>date('Y-m-d'),
  59. 'jam'=>date('H:i:s'),
  60. 'tagvid'=>$tag);
  61. }
  62. }else{
  63. if ($hasil_video['file_name']==''){
  64. $data = array('id_playlist'=>$this->input->post('a'),
  65. 'username'=>$this->session->username,
  66. 'jdl_video'=>$this->input->post('b'),
  67. 'video_seo'=>seo_title($this->input->post('b')),
  68. 'keterangan'=>$this->input->post('c'),
  69. 'gbr_video'=>$hasil['file_name'],
  70. 'video'=>'',
  71. 'youtube'=>$this->input->post('e'),
  72. 'dilihat'=>'0',
  73. 'hari'=>hari_ini(date('w')),
  74. 'tanggal'=>date('Y-m-d'),
  75. 'jam'=>date('H:i:s'),
  76. 'tagvid'=>$tag);
  77. }else{
  78. $data = array('id_playlist'=>$this->input->post('a'),
  79. 'username'=>$this->session->username,
  80. 'jdl_video'=>$this->input->post('b'),
  81. 'video_seo'=>seo_title($this->input->post('b')),
  82. 'keterangan'=>$this->input->post('c'),
  83. 'gbr_video'=>$hasil['file_name'],
  84. 'video'=>$hasil_video['file_name'],
  85. 'youtube'=>$this->input->post('e'),
  86. 'dilihat'=>'0',
  87. 'hari'=>hari_ini(date('w')),
  88. 'tanggal'=>date('Y-m-d'),
  89. 'jam'=>date('H:i:s'),
  90. 'tagvid'=>$tag);
  91. }
  92. }
  93. $this->model_app->insert('video',$data);
  94. redirect($this->uri->segment(1).'/video');
  95. }else{
  96. $data['record'] = $this->model_app->view_ordering('playlist','id_playlist','DESC');
  97. $data['tag'] = $this->model_app->view_ordering('tagvid','id_tag','DESC');
  98. $this->template->load('administrator/template','administrator/mod_video/view_video_tambah',$data);
  99. }
  100. }
  101.  
  102. function edit_video(){
  103. cek_session_akses('video',$this->session->id_session);
  104. $id = $this->uri->segment(3);
  105. if (isset($_POST['submit'])){
  106. $config['upload_path'] = 'asset/img_video/';
  107. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG|mp4|MP4';
  108. $config['max_size'] = '3000'; // kb
  109. $this->load->library('upload', $config);
  110. $this->upload->do_upload('d');
  111. $hasil=$this->upload->data();
  112.  
  113. $this->upload->do_upload('video');
  114. $hasil_video=$this->upload->data();
  115.  
  116. if ($this->input->post('f')!=''){
  117. $tag_seo = $this->input->post('f');
  118. $tag=implode(',',$tag_seo);
  119. }else{
  120. $tag = '';
  121. }
  122.  
  123. if ($hasil['file_name']==''){
  124. if ($hasil_video['file_name']==''){
  125. $data = array('id_playlist'=>$this->input->post('a'),
  126. 'username'=>$this->session->username,
  127. 'jdl_video'=>$this->input->post('b'),
  128. 'video_seo'=>seo_title($this->input->post('b')),
  129. 'keterangan'=>$this->input->post('c'),
  130. 'video'=>'',
  131. 'youtube'=>$this->input->post('e'),
  132. 'tagvid'=>$tag);
  133. }else{
  134. $data = array('id_playlist'=>$this->input->post('a'),
  135. 'username'=>$this->session->username,
  136. 'jdl_video'=>$this->input->post('b'),
  137. 'video_seo'=>seo_title($this->input->post('b')),
  138. 'keterangan'=>$this->input->post('c'),
  139. 'video'=>$hasil_video['file_name'],
  140. 'youtube'=>$this->input->post('e'),
  141. 'tagvid'=>$tag);
  142. }
  143. }else{
  144. if ($hasil_video['file_name']==''){
  145. $data = array('id_playlist'=>$this->input->post('a'),
  146. 'username'=>$this->session->username,
  147. 'jdl_video'=>$this->input->post('b'),
  148. 'video_seo'=>seo_title($this->input->post('b')),
  149. 'keterangan'=>$this->input->post('c'),
  150. 'gbr_video'=>$hasil['file_name'],
  151. 'video'=>'',
  152. 'youtube'=>$this->input->post('e'),
  153. 'tagvid'=>$tag);
  154. }else{
  155. $data = array('id_playlist'=>$this->input->post('a'),
  156. 'username'=>$this->session->username,
  157. 'jdl_video'=>$this->input->post('b'),
  158. 'video_seo'=>seo_title($this->input->post('b')),
  159. 'keterangan'=>$this->input->post('c'),
  160. 'gbr_video'=>$hasil['file_name'],
  161. 'video'=>$hasil_video['file_name'],
  162. 'youtube'=>$this->input->post('e'),
  163. 'tagvid'=>$tag);
  164. }
  165. }
  166.  
  167. $where = array('id_video' => $this->input->post('id'));
  168. $this->model_app->update('video', $data, $where);
  169. redirect($this->uri->segment(1).'/video');
  170. }else{
  171. $record = $this->model_app->view_ordering('playlist','id_playlist','DESC');
  172. $tag = $this->model_app->view_ordering('tagvid','id_tag','DESC');
  173. if ($this->session->level=='admin'){
  174. $proses = $this->model_app->edit('video', array('id_video' => $id))->row_array();
  175. }else{
  176. $proses = $this->model_app->edit('video', array('id_video' => $id, 'username' => $this->session->username))->row_array();
  177. }
  178.  
  179. $data = array('rows' => $proses,'record' => $record, 'tag' => $tag);
  180. $this->template->load('administrator/template','administrator/mod_video/view_video_edit',$data);
  181. }
  182. }
Sugandi Anarki
commented on 12 Des 2019 20:26:20
  1. Assalamualaikum,.. video masih tetep belum bisa di upload min, ada masukan lain min.
  2.  
  3. semua sudah di rubah ketika dilakukan penambahan tidak bisa...????
Bukhori Muslim
commented on 13 Des 2019 05:57:23
  1. Assalamualaikum,.. cek lagi tahapan diatas dengan teliti gan,
  2. saya sudah cobakan dan video berhasil di upload.
  3. pastikan juga untuk menyesuaikan config file size koding diatas :
  4. $config['max_size'] = '3000';
  5.  
  6. karena dikoding diatas saya set maksimal ukuran video hanya 3000 (3 MB),
  7. bisa jadi karena hal tersebut, ubah saja menjadi, misal :
  8. $config['max_size'] = '50000'; // 50 MB
Sugandi Anarki
commented on 13 Des 2019 22:02:41
  1. Assalamualaikum,.. selamat malam min, sudah saya rubah juga. tp tetep proses tambah tidak terjadi, apakah ada yang salah ???
  2.  
  3. saya memodif file admnistrator.php dari folder control
Sugandi Anarki
commented on 13 Des 2019 22:47:21
  1. Assalamualaikum,.. proses tambah berhasil, tapi tidak tampil hasil di halaman awal web min???
Terdapat 1 File dilampirkan :
1. aaa.png (96 KB)
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online