jwplayer made easy - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: jwplayer made easy (/showthread.php?tid=47694) |
jwplayer made easy - El Forum - 12-18-2011 [eluser]skunkbad[/eluser] I use jwplayer to play videos on my website. It's nice because it plays with Flash or HTML5, and HTML5 is necessary if you want to have videos that people can watch on their iPads. So I made this little library to make adding videos in views super easy: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); This is the XML config: Code: <?xml version='1.0' encoding='UTF-8' ?> And usage in the view: Code: echo $this->video_player->jw_embedder( array( You'll of course have to have jwplayer and call jwplayer.js in the head, and load the video player library in your controller: Code: $this->load->library('video_player'); That's it. Have fun. Oh, and the [removed] is the opening and closing script tags. jwplayer made easy - El Forum - 10-08-2012 [eluser]sarbaz[/eluser] A problem:-S The video could not be loaded, either because the server or network failed or because the format is not supported: http://localhost/alma/images/videos/video.webm Code: echo $this->video_player->jw_embedder( array( jwplayer made easy - El Forum - 10-08-2012 [eluser]osci[/eluser] Many servers don't know the webm media type. You have to add it through htaccess or ask your hosting provider to do so. |