Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yusuf Cakmak yusufcakmak

🏠
Working from home
View GitHub Profile
View build.gradle
compile 'com.google.android.exoplayer:exoplayer:r2.X.X'
@yusufcakmak
yusufcakmak / build.gradle
Last active Dec 1, 2018
exogradlemodules
View build.gradle
implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.X.X'
View customview.xml
<com.yusufcakmak.exoplayersample.customview.CustomExoPlayerView
android:id="@+id/custom_player_view"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
View playpause.java
private void updatePlayPauseButton() {
if (!isVisible() || !isAttachedToWindow) {
return;
}
boolean playing = player != null && player.getPlayWhenReady();
String contentDescription = getResources().getString(
playing ? com.google.android.exoplayer2.R.string.exo_controls_pause_description : com.google.android.exoplayer2.R.string.exo_controls_play_description);
playButton.setContentDescription(contentDescription);
playButton.setImageResource(
playing ? R.drawable.pausecontrol : R.drawable.playcontrol);
View gist:b19371a0c9c22f5c04ff8b461b422ffd
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push origin master
View ExtractorMediaSource
extractorsFactory = new DefaultExtractorsFactory();
MediaSource mediaSource = new ExtractorMediaSource(Uri.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"),
mediaDataSourceFactory, extractorsFactory, null, null);
View exoplayervideo
simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
simpleExoPlayerView.requestFocus();
simpleExoPlayerView.setPlayer(player);
MediaSource mediaSource = new HlsMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"),
mediaDataSourceFactory, mainHandler, null);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
View exoplayer
mediaSource = new ExtractorMediaSource(Uri.parse(radioUrl),
dataSourceFactory,
extractorsFactory,
null,
null);
player.prepare(mediaSource);
View JavaMap
public class JavaMap {
public static void main(String[] args) {
// Takımları temsil eden kısaltmaları ve isimleri ile Map oluşturuyoruz. Böylece her takım kısaltmasına karşılık takım ismi gelecek.
// put metotu ile ekleme yapıyoruz.
Map<String, String> teamMap = new HashMap<>();
teamMap.put("bjk","Besiktas");
teamMap.put("gs","Galatasaray");
View web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Thymeleaf Example</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>