預設的summernote是沒有提供image title與alt的編輯ui,
你可以安裝summernote-image-title來達成這個功能。
https://github.com/asiffermann/summernote-image-title
星期五, 1月 20, 2017
星期三, 1月 18, 2017
[Objective-C] iOS 基本技能: 呼叫相機
超常用的iOS呼叫相機基本技能,測試完記錄一下。
優點就是彈性比較大,速度快
使用UIImagePickerController (簡單、快速)
- (void) initCamera{
NSLog(@"initCamera");
dispatch_async(dispatch_get_main_queue(), ^{
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
//檢查是否支援此Source Type(相機)
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
NSLog(@"Access Camera Device");
//設定影像來源為相機
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
//顯示UIImagePickerController
[self presentViewController:imagePicker animated:YES completion:nil];
}
else {
//提示使用者,目前設備不支援相機
NSLog(@"No Camera Device");
}
});
}
//使用者按下確定時
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
//取得剛拍攝的相片(或是由相簿中所選擇的相片)
UIImage *image=[info objectForKey:UIImagePickerControllerEditedImage];
//設定ImageView的Image物件,例如:
//yourImageView.image = image;
[picker dismissViewControllerAnimated:YES completion:^{}];
}
//使用者按下取消時
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
//一般情況下沒有什麼特別要做的事情
[picker dismissViewControllerAnimated:YES completion:^{}];
}
使用AV Foundation
優點就是彈性比較大,速度快
[Objective-C] 初試一下 youtube live streaming (二) 實作步驟
找到幾篇有關於直播的教學,但都2014了,還是可以參考一下。
以下簡述使用Youtube直播步驟。
http://yhsiang.logdown.com/posts/2014/04/16/stream-to-youtube-with-live-streaming-api
https://youtube-eng.googleblog.com/2014/10/watchme-live-stream.html
http://justinyang1221.blogspot.tw/2014/10/live-stream-youtubestreaming-to-youtube.html
將即時串流推送到串流伺服器 (推流)
https://github.com/jgh-/VideoCore
https://github.com/LaiFengiOS/LFLiveKit => 最好操作整合,很多人拿來二次開發
https://github.com/pili-engineering/PLMediaStreamingKit
顯示即時串流 (拉流)
https://github.com/Bilibili/ijkplayer
完整流程
以下是最後實作完驗證過的流程,這篇也講的很清楚。
http://octuplus.co/Detalles/2084/Cannot-make-transition-of-my-Youtube-broadcast-to-live-using-Youtube-API
以下簡述使用Youtube直播步驟。
http://yhsiang.logdown.com/posts/2014/04/16/stream-to-youtube-with-live-streaming-api
https://youtube-eng.googleblog.com/2014/10/watchme-live-stream.html
http://justinyang1221.blogspot.tw/2014/10/live-stream-youtubestreaming-to-youtube.html
將即時串流推送到串流伺服器 (推流)
https://github.com/jgh-/VideoCore
https://github.com/LaiFengiOS/LFLiveKit => 最好操作整合,很多人拿來二次開發
https://github.com/pili-engineering/PLMediaStreamingKit
顯示即時串流 (拉流)
https://github.com/Bilibili/ijkplayer
完整流程
以下是最後實作完驗證過的流程,這篇也講的很清楚。
http://octuplus.co/Detalles/2084/Cannot-make-transition-of-my-Youtube-broadcast-to-live-using-Youtube-API
So a bit unclear rule is:
- ensure you have broadcast and livestream created and ready.
and ensure that broadcast lifecycle status is notCOMPLETE, otherwise recreate broadcast ... so ensure that your broadcast lifecycle status isready - bind broadcast to livestream
- start publishing video to livestream
- wait for livestream status
active - transition to
testing(yes, you have to do it instead of moving tolive) - wait for broadcast
lifeCycleStatusto becometesting - transition to
live - wait for broadcast
lifeCycleStatusto becomelive
You cannot skip
testing and cannot transition from complete to testing or ready.星期六, 1月 14, 2017
[ubuntu] 搞壞了sudo...must be owned by uid 0 and have the setuid bit set
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
XD不小心下錯了chown的指令,然後sudo就爆了。
搞了一小時還是沒弄好機器,
還是重裝VM的存檔-,,-
有招一日再來研究研究
http://ithelp.ithome.com.tw/articles/10053821
https://my.oschina.net/cxz001/blog/297404
http://unix.stackexchange.com/questions/16962/how-to-get-back-sudo-on-ubuntu
星期一, 1月 09, 2017
星期四, 1月 05, 2017
[Objective-C] AVPlayer 操作筆記
測試一下用Objective-C播放影片的sample
//NSBundle resourcePath
//NSBundle URLForResource
Sample檔放到專案
前面二個項目要打勾
取得應用程式目錄的檔案
//NSBundle resourcePath
NSString *filePath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"SampleVideo_360x240_30mb.mp4"];
//NSBundle URLForResource
NSURL *sourceMovieURL = [[NSBundle mainBundle]URLForResource:@"SampleVideo_360x240_30mb" withExtension:@"mp4"];
星期四, 12月 29, 2016
[Objective-C] Youtube Oauth2 實作
記錄一下第一次寫iOS如何與Youtube Oauth2串接
所以改用NSURLSession來處理request,在把結果丟給webview來呈現
成功後你會取得一個auth code: 例如
http://localhost/oauth2callback?code=
首先要申請API KEY跟Oauth要用的Client ID
Oauth2的驗證url記錄
https://accounts.google.com/o/oauth2/auth?client_id=<你的CLIENTID>.apps.googleusercontent.com&redirect_uri=http://localhost&scope=https://www.googleapis.com/auth/youtube&response_type=code&access_type=offline403的爆炸
用webview直接丟Oauth2的連結,google會爆給你不允許存取的403 (disallowed_user-agent)
所以改用NSURLSession來處理request,在把結果丟給webview來呈現
成功後你會取得一個auth code: 例如
http://localhost/oauth2callback?code=
[Objective-C] 剛轉入寫iOS Objective的一些簡單筆記~
記錄一下菜到不行的初學者(我本人XD)Objective-C 寫的筆記
[self dismissViewControllerAnimated:true completion:nil];
By using below line we can go to parent view controller
變數宣告strong跟weak
用segue轉到另一個view如何退上去的方法
[self dismissViewControllerAnimated:true completion:nil];
用Navigation控制轉viewController
By using below line we can go to parent view controller
[self.navigationController popViewControllerAnimated:YES];
By using below line we can move to main/root view controller
By using below line we can move to main/root view controller
[self.navigationController popToRootViewControllerAnimated:YES];
By using below line we can move to any view controller
By using below line we can move to any view controller
[self.navigationController popToViewController:viewControllerObject animated:YES];
星期二, 12月 27, 2016
星期日, 12月 25, 2016
[Objective-C] 初試一下youtube live streaming (一) 相關資源蒐集
記錄一下工作需要研究的youtube live streaming的呼叫
前置作業
要先到https://console.developers.google.com/ 要先開一個專案並申請api金鑰
帳號啟用直播功能
如果帳號未啟動直播功能,會噴以下錯誤
{
error = {
code = 403;
errors = (
{
domain = "youtube.liveBroadcast";
extendedHelp = "https://www.youtube.com/features";
message = "The user is not enabled for live streaming.";
reason = liveStreamingNotEnabled;
}
);
message = "The user is not enabled for live streaming.";
};
帳號啟用直播功能
如果帳號未啟動直播功能,會噴以下錯誤
{
youtube官方文件
https://support.google.com/youtube/answer/2853700?hl=en&ref_topic=6136989YouTube Live Streaming API Overviewhttps://developers.google.com/youtube/v3/live/getting-started
YouTube Live Streaming API Code Samples (JAVA/PHP/PYTHON)
Objective C libs for REST
星期一, 12月 19, 2016
[Lavavel] Laravel 5.2 could not open laravel.log
今天跑seed的時候發生laravel.log無法打開的錯誤。
找到StackFlow的解法如下:
http://stackoverflow.com/questions/35715400/laravel-5-2-could-not-open-laravel-log
找到StackFlow的解法如下:
http://stackoverflow.com/questions/35715400/laravel-5-2-could-not-open-laravel-log
Try the following commands on your shell:
- Clear Laravel cache and the compiled classes
php artisan cache:clearphp artisan clear-compiled - Change the storage and cache directories permission
sudo chmod -R 777 storagesudo chmod -R 777 bootstrap/cache - Regenerate the composer autoload file
composer dump-autoload
[Lavarel] elixir verison 爆掉
試一下version()方法來做版控就爆了
SyntaxError: Unexpected token s in JSON at position 41
at Object.parse (native)
at VersionTask.deleteManifestFiles (/var/www/你的專案/node_modules/laravel-elixir/dist/tasks/VersionTask.js:113:29)
如果遇到version錯誤的話,記得把public/build/rev-manifest.json的格式產生異常了,
可以手動修正。
SyntaxError: Unexpected token s in JSON at position 41
at Object.parse (native)
at VersionTask.deleteManifestFiles (/var/www/你的專案/node_modules/laravel-elixir/dist/tasks/VersionTask.js:113:29)
如果遇到version錯誤的話,記得把public/build/rev-manifest.json的格式產生異常了,
可以手動修正。
星期三, 12月 14, 2016
[360] 一些有關於360的照片與影片的web播放技術
記錄一下怎麼在Web實作相關的360照片與影片的播放。
主要採用WebGL來處理,大部份的作者則透過three.js來操作WebGL
基礎觀念可以看的開源
簡單的three.js範例
http://www.emanueleferonato.com/2014/12/10/html5-webgl-360-degrees-panorama-viewer-with-three-js/簡單的photo spheres製作
http://blog.mastermaps.com/2014/01/photo-spheres-with-threejs.html簡單用three.js做的panorama video example => 基於three.js
https://gist.github.com/bellbind/9080f608a56c2637aec9
星期三, 12月 07, 2016
[Git] error: insufficient permission for adding an object to repository database .git/objects 異常處理
error: insufficient permission for adding an object to repository database .git/objects
今天在pull 的時候噴了這個錯誤~
找到了有人的解法如下
cd
cd .git/objects
sudo chown -R : *
[jQuery Plugins] 號稱最好用的廣告輪播owl carousel套件
大部份的landing page都會在最上面放一個很大的廣告橫幅,
Owlcarousel為許多工程師首選的套件,支援RWD,以及多種的橫幅表達方式
官網好像失效了,改到github https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html
[Gulp] 快快樂樂學Gulp與Lavarel Elixir
由於最近開始與後端工程師使用Lavarel框架+Angular實作系統。
順便把拖了很久的Gulp前端工具記錄一下。
http://www.slideshare.net/yvonne_yu/cp-gulp
http://www.slideshare.net/appleboy/automating-your-workflow-with-gulp
https://laravel.tw/docs/5.2/elixir#copying-files-and-directories
http://adamalbrecht.com/2014/06/20/building-your-angular-app-with-gulp-js/
順便把拖了很久的Gulp前端工具記錄一下。
參考
http://www.slideshare.net/yvonne_yu/cp-gulp
http://www.slideshare.net/appleboy/automating-your-workflow-with-gulp
https://laravel.tw/docs/5.2/elixir#copying-files-and-directories
http://adamalbrecht.com/2014/06/20/building-your-angular-app-with-gulp-js/
星期二, 12月 06, 2016
[jQuery] 簡單易物的jquery gallery 套件: lightbox2
今天將公司的sharktech.tw 官網改了一下lightbox套件,於是找到Lokesh Dhakar這個作者寫的。
因為太好套了所以推給大家。只要加上data-lightbox這個屬性,即可做單張preivew或群組(gallery)的preview效果了。
星期六, 12月 03, 2016
[Bower] EACCES: permission denied .config/configstore/bower-github.json爆炸了的解決方法lol
如題
sudo chown -R $USER:$GROUP ~/.npmsudo chown -R $USER:$GROUP ~/.config
星期一, 11月 28, 2016
Vue.js 2.0 支援的套件
整理一下vue.js 2.0可以跑的元件
用戶
http://pespantelis.github.io/vue-crop/
https://eliep.github.io/vue-avatar/
進度條
http://hilongjw.github.io/vue-progressbar/index.html
日期格式
https://github.com/egoist/vue-timeago
https://github.com/charliekassel/vuejs-datepicker
http://blog.w3cub.com/vue2-calendar/
分頁
https://github.com/TahaSh/vue-paginate
https://github.com/matfish2/vue-pagination-2
用戶
http://pespantelis.github.io/vue-crop/
https://eliep.github.io/vue-avatar/
進度條
http://hilongjw.github.io/vue-progressbar/index.html
日期格式
https://github.com/egoist/vue-timeago
https://github.com/charliekassel/vuejs-datepicker
http://blog.w3cub.com/vue2-calendar/
分頁
https://github.com/TahaSh/vue-paginate
https://github.com/matfish2/vue-pagination-2
[Webpack] 解決jquery在webpack載入全域的處理方法
webpack真是個很屌但不熟會搞死人的東西,
為了搞一個全域的jquery函式庫,
找到StackFlow裡面一個大神提供的各種解法
這位大大也有遇到一樣的事:D
https://blog.fntsr.tw/articles/2016/09/13/%E8%AE%93-jquery-%E5%9C%A8-webpack-%E4%B8%AD%E6%88%90%E7%82%BA%E5%85%A8%E5%9F%9F%E8%AE%8A%E6%95%B8/
為了搞一個全域的jquery函式庫,
找到StackFlow裡面一個大神提供的各種解法
這位大大也有遇到一樣的事:D
https://blog.fntsr.tw/articles/2016/09/13/%E8%AE%93-jquery-%E5%9C%A8-webpack-%E4%B8%AD%E6%88%90%E7%82%BA%E5%85%A8%E5%9F%9F%E8%AE%8A%E6%95%B8/
備份文章
訂閱:
意見 (Atom)














