Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rimelek/ybb
BB Code interpreter for youtube videos
https://github.com/rimelek/ybb
bbcode php youtube youtube-video
Last synced: 5 days ago
JSON representation
BB Code interpreter for youtube videos
- Host: GitHub
- URL: https://github.com/rimelek/ybb
- Owner: rimelek
- License: mit
- Created: 2017-07-16T20:24:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-17T18:36:31.000Z (over 7 years ago)
- Last Synced: 2024-10-12T20:03:23.259Z (about 1 month ago)
- Topics: bbcode, php, youtube, youtube-video
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
## Description
This is just a simple function convert youtube video links or video IDs to the video embed code using BB codes.
You can pass arguments to the BB code or you can disable them.
# Arguments- **nocookie**: Default: "off". If it is "on" youtube-nocookie.com will be used as domain.
- **controls**: Default: "on". Whether you want to show control buttons or not.
- **suggestions**: Default: "on". You can turn suggestions after the video on or off.
- **showinfo**: Default: "on". In case of "off" the title of the video and other information will be hidden.
- **width**: Default: 560. Width in pixels
- **height**: Default: 315. Height in pixelsYou can completely omit the value if it is "on". "nocookie" means the same as "nocookie=on"
## Examples
### BB codes
[youtube showinfo=off]https://www.youtube.com/watch?v=tH2TvzgFCU0[/youtube]
[youtube]https://youtube.com/watch?v=tH2TvzgFCU0[/youtube]
[youtube]http://www.youtube.com/watch?v=tH2TvzgFCU0[/youtube]
[youtube]//www.youtube.com/watch?v=tH2TvzgFCU0[/youtube]
[youtube]https://youtu.be/tH2TvzgFCU0[/youtube]
[youtube]http://youtu.be/tH2TvzgFCU0[/youtube]
[youtube]//youtu.be/tH2TvzgFCU0[/youtube]
[youtube suggestions=off]tH2TvzgFCU0[/youtube]
[youtube width=350 height=300 nocookie controls=off]tH2TvzgFCU0[/youtube]
### Usage of the function'on']);
echo YBB\ybb($text, ['nocookie' => 'on'], ['width', 'height']);
Instead of "on", you can always write "yes", "1", or "true"
Instead of "off", you can always write "no", "0" or "false"
Run [demo.php](demo.php) for a working demo.