Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Docker #89

Open
stevetuk71 opened this issue Nov 19, 2016 · 6 comments
Open

Modify Docker #89

stevetuk71 opened this issue Nov 19, 2016 · 6 comments

Comments

@stevetuk71
Copy link

stevetuk71 commented Nov 19, 2016

Hi I have been using peerflix-server for sometime and think its brilliant. Thanks.

I modified the index.html and main.html file to allow me to create a cast icon and push the URL of the media link to Chromecast URL player, this allows me to play the media directly from my chromcast.

I have recently been looking at Docker and thought this would be a better way than having to modify the files directly but have failed miserably.

I pulled and started a container and used docker exec to modify the files, then used commit to create a new image. when starting a new container from the modified image, it still doesn't have my modifications. I also tried modifying the files directly in the Docker volume under aufs/mnt.

Probably my noobie understanding of Docker, but any help would be appreciated.

@Porco-Rosso
Copy link

I would try creating a fork of peerflix-server with your changes, and then pulling that into a docker image you create.
Docker isn't designed to persist changes, from what I gather.

@asapach
Copy link
Owner

asapach commented Nov 19, 2016

Pull request is welcome. I don't own a Chromecast, but would be happy to merge your changes.

@stevetuk71
Copy link
Author

Thanks Aliaksei, but would expect it needs a little work prior to a merge :-)

In index

<script>
function createCastLinks() {
    var elements = document.getElementsByTagName('a');
    for (var i = 0; i < elements.length; i++) {
        if (elements[i].href.split('.')[elements[i].href.split('.').length - 1] == 'mp4') {
            elements[i].innerHTML = elements[i].innerHTML + '</a> <a style="float:right" href="http://movies.foamsnet.com/url/?url=https://[sub.domain.suffix]' + elements[i].href.split('[domain.suffix]')[1] + '&"><div class="cast-small"></div>';
        }
    }
}
</script>

obviously the domain.suffix is unique.

<link rel="stylesheet" href="styles/override.css"><body onload="createCastLinks()" ng-app="peerflixServerApp">

in main

<a class="btn btn-primary" onclick="createCastLinks()"><div class="cast-medium-white">

in style override.css

.cast-small {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAA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JDLDZAy8vHfszrtvHyBDZwuFArx8/uHqmirWWg8brdW06znv892UXCuttaW1htYaRhuAGAqApZSykpOp5onxyS22Y78Ixpgxpj2TybqpZHp/sVg8JKR83RizXikpQuHgiFJq3WLri1ISlq2ClwFYQgoAgqUU8WDI7XFc552x0fEkCK7neRtjVZXHUuk0iAlCyrr6VbVdUsn7AaEWdakQQriuc/HbRIot27V1dU3844qK0DplWa6UcrAqHjskpbzPdm1EK6MDtcXiEdsJrLFt+8+bG+pPBcPBk4WcJ+Zdi6gkjOsgiTQhmZri/hP9vlLfOz0qJ8Ymg8aQAOBZAUuSIcuQgSVVXkhpG2OUMaaotfZee/qulb/GFSur/QXOuSy0J6FFTgAAAABJRU5ErkJggg==);
height: 33px;
width: 33px;
}
.cast-medium-white {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAfCAMAAAAocOYLAAAB+1BMVEUAAACWj4KYkYTU0crz9vv19/v7//////8AAAD19fT////m5OD///8AAAAMAAD///8AAAA2Jw84KhJENx/s6+j////l4+D08/H+/v7///////+blYj////h391bTTduZFKCeWn///+Fe2r///9zallzbFv5+fpzaFRzaFVzaVZ0alerpZp5cF6OhniAd2fb292Ad2fS0tL8/f2QiHqEfGyDe2yIgHGNhXfPy8WjnZGgmo6inJCjnJGclYnn5uO+urLp6uz////Ixb+knpPKycXb2tX+//+YkIT////////FxMH49/bS0M/k4t69urTW08/////Oy8X5+fmknpL+/v7////MzMr////////////9/fz///////+0r6bh4N7Lx8D+/v3+/v76+vr19fX///+jnpX////w8O7///+2s63Jxr6yraTb2dTe3dm0saq2saj////////////+///n5+TQz8zS0MvS0M3T0czU0czU0s3V0czV0szV0s3AvLXh39zV0s38/f6tqJ3f3dj+/f3c2tX9/f2qpZrPzsvQzcfQzsrS0c/p5+Svqp/OzsrOzsvPzsrPzsve3Nf////U0s7////y8fD+//////++urP7+/v////////Oy8XPzMbQzcfb2NTo6Ojp5+Tp6ejq6ebz8vH+/v///v7///8zs/QUAAAAnXRSTlMAAAAAAAAAAAEBAQICBAQEBQUFBQYGBwgICAkMDxASFRUZGhodHR0eHh4eISMmLTI3ODk6P0JCQ0RHSEhITE5PVVtsbnBwd4CCg4SEhYyOkpKTk5WYmJubnp+hoaKjp6iqra+ws7S1ur3FxcnM0NHR0dTZ2tzh4eHh4eHh4eHi4uPk5+fn6Ojs7e3t7e3u7u7u7u7v8fHy9fb3+vv+v3M77gAAAT1JREFUeNq9z2VTwwAMgOGgg7Hi7jCgG+7uPtzd3V0GDBvuLe4u+Zm0jDu4dt0+wfv1Se4S+OtEOtWYGXCX+ggkdQAAcT0KNsx6tbCvWGv88f6B190r4iKh8YOUhGROSYm9iKpvV9uCAScwb/zZV9sALzHjKp2uf39ej8+wXiXs04xDzvL5lp12VxJglVFYXpJnxndJ09f9Ll14OV4bACIT7f85tjwh3k5GCv0via/sPr3B1TAw0uquPdiXWrCJ+0HAqQ5xgQCnznfE3PQzHPBQKPJ/pRhDnCPAIq3/Ba+LGvAtawK5KZn72zoiLnCq9AQHy3g+S4BzO9ZU4HPr+sdS9h5FUzQbRW0f0rv00Ygl2BcfX2Wu7TQPbYwGe8pIeSDJJCP9SdJPTvqaAnjFxHmHx4aERke5gZ4M4d/7BD5SwUQN1YI+AAAAAElFTkSuQmCC);
height: 31px;
width: 31px;
float: right;
}

@asapach
Copy link
Owner

asapach commented Nov 20, 2016

@stevetuk71 a couple of notes:

  • index.html
  • main.html
    • Is there a way to detect if Chromecast is available and only show the icon when it's connected?
  • override.css
    • I'd rather name the file chromecast.css

@stevetuk71
Copy link
Author

stevetuk71 commented Nov 21, 2016

Hi,

Thanks for the feedback.

I am not familiar with Angular. I will look into changing.

I do actually install castplayer.js locally. Only used the external reference to point to a working example of the chromecast URL :-)

Apparently you can check for the presence of "CrKey" in the user agent of the browser.. Although sending the URL to the selected cast, will still be a manual choice.

chromecast.css does make more sense :-)

@pataquets
Copy link

@stevetuk71 : I love the idea, it would be a great addition.
Since it has been some time since you posted the issue, I would encourage you to push the changes to your fork, no matter how finished or not they are. Even if you're no longer interested in pushing them, somebody else might be and this would enable them to pick up where you left. It would be a pity that whatever you have accomplished ended up wasted or lost. Don't worry if it's not still polished nor elegant, that's OK and you're not even required to finish it yourself ;)
I guess you made it work already, so it will bi useful no matter what.

Also, if you're still interested in creating a Docker image, the easiest way to solve your need would be to to create an Automated Build on Docker Hub. It's very easy, indeed, but ping me anyway if you need help.
HTH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants