Why Doesn'typutube Go Back to the Previous Video When I Press Back
Description
- Open YouTube video directly in picture-in-picture from the YouTube app or Safari
- Support for 720p and 360p
- Control playback speed
- Quickly jump forward or backward in video
- Play live videos
- Light and dark theme support
How to use
- Install the Shortcut
- Install Scriptable AppStore
- Open a YouTube video in the YouTube app.
- Press the share button and select "More"
- Run the Shortcut by selecting "YouTube PiP" on the list (protip: add it as a favorite in the share sheet to move it to the top of the list)
Requirements
- To install 3rd party Shortcuts you enable "Allow untrusted Shortcuts" in iOS Settings -> Shortcuts
- The Shortcut is build using Scriptable and this app must be installed. It's a free app with a tip jar.
- Works on any device running iOS14 or iPadOS13 or newer.
Advanced
For advanced users its possible to tweak the Shortcut a bit using the configuration at the top of the Shortcut.
- pip: If true Picture-in-Picture will automatically be enabled after the video has loaded. Set to false to keep the video in the player window.
- speed: The default selected playback speed. Valid values are 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75 and 2.0
- hd: The preselected quality. If true the highest quality available will be selected (currently 720p)
- completion: Optional parameter. The name of a Shortcut that will be executed just after PiP has been automatically enabled. This is useful for running a Shortcut that will show the SpringBoard such as https://www.icloud.com/shortcuts/e1b2044fb3eb4134880954bad71681df
- theme: The theme to use it in player. Empty value will automatically select theme based on system appearance. Valid values are: nord, polar and ocean-next
Thanks to @Saha_ for the Shortcut update steps.
Latest Release Notes
4.5 - June 26, 2021, 7:31 a.m.
Fixes the shortcut
Version history
Feedback
Log in or sign up to leave feedback.
@Saha_
Loved it! :) Btw did you use my embedded update style, I am just curious?
Reply · 1 year, 2 months ago
@petergam Author
Thanks, I appreciate that. Yes I totally did. I hope that's okay by you. I love that it doesn't depend on other Shortcuts. I have added some acknowledgement to the description :)
Reply · 1 year, 2 months ago
@Saha_
It's completely fine.Thanks for the credit though.Happy shortcutting :)
Reply · 1 year, 2 months ago
@TonyT
Hello I was wondering if you could explain how to tweak this to make it so that when the shortcut asks for the URL, if it could automatically paste from the clipboard, and possibly run afterwards as well. Or point to a good source to discover how to learn to do this.
Reply · 1 year, 2 months ago
@Joexg
I actually figured this out when v4 was released. Check this version out: https://www.icloud.com/shortcuts/2531034db067483d9d4b9bb59a12606c If you have a youtube link in clipboard, there are no extra prompts, the video just opens.
Reply · 1 year, 2 months ago
@rclark
Hmm .... link doesn't work for me. Says shortcut no longer available.
Reply · 8 months, 4 weeks ago
@Joexg
I think that's due to the shortcuts outage. Here's a fresh link, hopefully it works. https://www.icloud.com/shortcuts/89e31ec9a54943be8b8f633435ca8171
Reply · 8 months, 4 weeks ago
@Joexg
hey PeterGam, I made some tweaks to YouTube PiP that I think you should include as an update. This version checks if the clipboard contains a youtube link of any kind, and if it does, it will open that video in PiP without asking you to paste it in the Ask for Input menu. It'll even remove any other text that isn't part of the URL, for the best experience. If clipboard doesn't have a YouTube link, it behaves just like before. https://www.icloud.com/shortcuts/2531034db067483d9d4b9bb59a12606c
Reply · 1 year, 2 months ago
@humax9110
Great job We need the title of the video & download button
Reply · 1 year, 2 months ago
@ckcu
Hello. Many thanks for this great tool. Could you please also come up with a way for Youtube TV app, 60 Minutes App, CNN App? Appreciate it!
Reply · 1 year, 2 months ago
@staticMike
The app is great! It's great and makes my life so much easier but there's one thing that's lacking for me. I find myself using the YT PIP for longer videos mostly and I do not always start watching the vid straight away in pip mode. I wondered this issue must have been already addressed and I updated. I saw you added +/- 10sec rewind buttons which is great but we already have +/-15sec rewind buttons in the pip player. Wouldn't it be possible for you to add +/-1minute buttons? Many thanks!
Reply · 1 year, 2 months ago
@daggerDroid
Awesome work, Please add support for 240p(for those data saver users who wants to listen only)
Reply · 1 year, 1 month ago
@ReddPizzai
Thought it was great until it broke. Its broken now.
Reply · 1 year, 1 month ago
@bernard
It stopped working ;( any updates how to fix this?
Reply · 1 year ago
@ReddPizzai
https://www.macrumors.com/how-to/picture-in-picture-fix-youtube/ I would try this. Haven't gotten around to trying it but many people say it works
Reply · 1 year ago
@wojciech679
iPhone X, iOS 14.2. "Exception Occurree Error on line 599:20: SyntaxError: Invalid regular expression: missing terminating ] for character class
Reply · 1 year ago
@newac
In iOS 14.3 I have the error: "Error on line 609:20: SyntaxError: Invalid regular expression: missing terminating ] for character class"
Reply · 11 months, 3 weeks ago
@alissonrod
great idea! it Works very well! congratulations! I have a question: where can I see the privacy policy and terms of use? what data is sent for using this shortcut?
Reply · 11 months ago
@Despair
I have some UI suggestions, I'd appreciate if you added border radius (curves) to the buttons of about 4/3 px, changed the background color to rgb(28,31,34), changed the foreground color to rgb(25,27,30) and changed the color of the selected button to be a but darker than the provided foreground color.
Reply · 11 months ago
@ramip
First time using it. After sharing it opens the floating window with the settings, but the floating video is closed immediately after closing the settings window
Reply · 11 months ago
@lardonate
Yeah I keep getting that Exception occurred message but it only seems to happen on videos that are using Japanese text for me for some reason. Otherwise performing fine!! Nice job (Error on line 609:20: SyntaxError: invalid regular expression: missing terminating ] for character class)
Reply · 11 months ago
@eThor
I agree with you, I receive exactly the same error and it doesn't work at all :/
Reply · 9 months ago
@TobiSunny
I wanted to use it to listen to a book witch is read in 60 chapters on YouTube playlist: https://youtube.com/playlist?list=PL2msBkO3MUibxxEm_npgDWZ5Vee7dABhb but the shortcut works with other videos but not with those from this playlist. Do you know how to enable it? I keep getting the "Exeption occurred" message when trying.
Reply · 10 months, 1 week ago
@TobiSunny
I wanted to use it to listen to a book witch is read in 60 chapters on YouTube playlist: https://youtube.com/playlist?list=PL2msBkO3MUibxxEm_npgDWZ5Vee7dABhb but the shortcut works with other videos but not with those from this playlist. Do you know how to enable it? I keep getting the "Exeption occurred" message when trying.
Reply · 10 months, 1 week ago
@petergam Author
Can you try again with the latest version? You need to open each individual video. There is currently no support for loading a playlist of videos.
Reply · 7 months ago
@Lupin3
Thank you! I was hoping YT would have enabled this feature by now. Wondering if there's a way to add scrubbing? Not sure if it can be done, but would be good instead of having to either hit the skip back a lot or start the video over.
Reply · 10 months ago
@routin556
hello this is so great but I can't open this video https://youtu.be/tfvMnwTRt4Y
Reply · 9 months, 3 weeks ago
@yumax
144P or 244P please only listen
Reply · 9 months ago
@rclark
Shortcut not available. Link doesn't work. Thanks.
Reply · 8 months, 4 weeks ago
@yumax
Could you make a shortcuts let live stream url like m3u8 play with pip mode through scriptable?
Reply · 8 months, 3 weeks ago
@gelat
I'm getting error on line 300:103
Reply · 7 months, 1 week ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@tejasgadhia
Getting this error since this morning. Not sure how to fix it? Using version 4.3. https://share.icloud.com/photos/0bfyRs2H9VQNvSInFw6auarTw
Reply · 7 months ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@PFXiang
On IPad, iOS 14.5.1 the following popped up: Exeption Occured Error on line 300:103: TypeError: undefined is not an object (evaluating 'decoded.split("&").filter((line) => { return line.startsWith("player_response")})[0].split')
Reply · 7 months ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@Visceralway
It stopped working. :( any ideas to get it working again. I think it was YouTube app update
Reply · 7 months ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@kennxy
this shortcut is now broken, spitting out an error upon launch
Reply · 7 months ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@darknessbe4dawn
Do you have an update for this it stopped working
Reply · 7 months ago
@petergam Author
It should be working if you update to latest version :)
Reply · 7 months ago
@petergam Author
Hey everyone. I've published version 4.4 which should make the Shortcut work again. Sorry for the inconvenience but it was broken due to changes made by YouTube. Its a cat and mouse game.
Reply · 7 months ago
@darknessbe4dawn
Works perfectly thank you! I wish I understood how to do scripts and shortcuts. I do have one question is there a way to code it to make it auto play the next video in that same PIP I have open rather than having to go back to the YouTube app and share the next video?
Reply · 7 months ago
@BokChoy
Version 4.4 is NOT WORKING. Getting a line 301:103 error. I love this shortcut. Will you please update this with a fix ASAP!
Reply · 6 months ago
@arudmin
I have solved it. Description below.
Reply · 6 months ago
@arudmin
Please take a look my post below, I have found a solution :-)
Reply · 6 months ago
@Stenveel
Please, sign a petition asking YouTube to add Picture in Picture (PiP) support for iOS & iPadOS apps https://change.org/YouTubePiP
Reply · 6 months, 3 weeks ago
@kolbeinnk
Hi @petergam Thanks for a great plugin. I however can't seem to make it work. I had V3 which worked perfectly but in the new version I get a play sign with a strikethrough. Any idea what the error can be? See screenshot: https://share.icloud.com/photos/00cZx0C0rck4jGSQ7GQPCRUyA
Reply · 6 months, 3 weeks ago
@Widowild
Hello, I can't play the video in French which a shortcut https://www.youtube.com/watch?v=ADPWCf1wf0g
Reply · 6 months, 3 weeks ago
@kr0n0s
Probably just a one off video, but when I tried using the PIP on a video(that I ended up watching on my iPad's split screen mode), the video would load as a broken video link. Hope to see this get fixed soon! Great shortcut when you want a little background noise while working!
Reply · 6 months, 3 weeks ago
@danivideda
Hi. It seems the shortcut is not working anymore. I have error on line 301:103 when Scriptable is opened. I tried to look into the script but couldn't figure out what's causing the undefined objects. Thanks
Reply · 6 months ago
@Visceralway
Ohh no iz no work yet again! :(. Could you fix. Another note. Is it challenging for you to typically identify the YouTube update issue and apply the fix? Just curious how much work it is for you. Thanks again
Reply · 6 months ago
@mbourgon
Appears busted. Tried it on https://youtu.be/ghQnuBPWc6I and got error on line 301:103 … undefined is not an object (evaluating 'decoded.split("&").filter(line) => { return line.startsWith("player_response") })[0].split')
Reply · 6 months ago
@BehrBoy
I use this all the time but has anyone else get the Exception Occured: Error on line 303:103 TypeError: Undefined is not an object… and yes it has updated to v4.4? Is this a YT patch update?
Reply · 6 months ago
@MrJeffreyGee
This was working beautifully for me in the past, but recently stopped working again. Is there an update in the pipeline?
Reply · 6 months ago
@whydidyoubuyanewcar.com
iPad 7 iOS 14.6 it says ** Error on line 301:103 TypeError: undefined is not an object (evaluating 'decoded.split("&").filter((line) => { return line.
Reply · 6 months ago
@BehrBoy
Yeah, got this too, I think it was yesterday the June 17th or the 16th it stopped working. I got an update for the script but didn't work.
Reply · 6 months ago
@95oRANGEcRUSH
On 14.6 using version 4.4 of this shortcut. Getting a line 301:103 error. YouTube updated their app on 5/16/2021 so I assume their update broke this version of the shortcut.
Reply · 6 months ago
@dastefster
I am also getting the "301:103..." error reported above—possibly related to 'get video info' requests recently returning "private stream" for some URLs..?
Reply · 6 months ago
@BokChoy
Version 4.4 is NOT WORKING. Getting a line 301:103 error. I love this shortcut. Will you please update this with a fix ASAP!
Reply · 6 months ago
@arudmin
*** SOLVED *** YOU WILL HAVE TO FIND 298 STRING: let request = new Request(`https://www.youtube.com/get_video_info?video_id=${videoId}&el=detailpage&html5=1`) AND REPLACE WITH: let request = new Request(`https://www.youtube.com/get_video_info?video_id=${videoId}&c=TVHTML5&cver=6.20180913&html5=1`)
Reply · 6 months ago
@arudmin
Worked Link: https://www.icloud.com/shortcuts/797c839da31144449f4ce196bf73b8af
Reply · 6 months ago
@FLA5H
Is there a way to get this to work with live streams from YouTube as well? If not, is there a line we can change to get it to work on only livestreams and just have a second shortcut to make them PiP?
Reply · 6 months ago
@drawerapp
This shortcut has broken twice in the past one month or tow. So I published a much simpler shortcut does not require scriptable, hopefully will have less chance to break in the future. Check out here https://routinehub.co/shortcut/9496/
Reply · 6 months ago
@akaliquid
Hello. This script has been working for me great until recently. I just updated to the latest 4.4 version, but I'm still getting the same error: "Error on line 303:103: typeerror undefined is not an object….." There's more to the error message, but I'm not able to copy/paste it or upload a screenshot of it. Let me know if I should type out whole message.
Reply · 5 months, 3 weeks ago
@Rocky5
Couple comments up has the fix.
Reply · 5 months, 3 weeks ago
@petergam Author
Shortcut has been fixed again
Reply · 5 months, 3 weeks ago
@darknessbe4dawn
Thank you for keeping this updated!!i know I'm not the only one that appreciates it
Reply · 5 months, 3 weeks ago
@beatdigger
Thanks! The old version worked with livestreams and this version does not. Any chance we might see that functionality again?
Reply · 5 months, 3 weeks ago
@metandre
Thank you for updating this gem, for a week i felt kind of lost. Is there any way to donate something to you?
Reply · 5 months, 3 weeks ago
@IMDG
Would love to have that Download button again. Thanks for the script anyways!
Reply · 5 months, 2 weeks ago
@verrat
Thank you for this shortcut, made my life more easier! Can you add for 144p or 240p resolution? For listening music while reading comics or novel. Thanks for this shortcut!! :)
Reply · 5 months ago
@beatdigger
Broken again as of 7/22/21. Seems to break with every YouTube or IOS update. Such a bummer because this truly was a game changer for me.
Reply · 4 months, 4 weeks ago
@melzjoi
Just tried the YouTube PIP script. Doesn't work on Safari (iPhone) Also installed the Scriptable app. Any help on how to use this? Getting this error: Error on line 301:103: TypeError: Undefined is not an object.... Don't have the Youtube app on my phone and I'm currently on ios 15 beta.
Reply · 4 months, 4 weeks ago
@Kpat80
Its broken because of the youtube update, youll have to wait for the shortcut owner to fix it again. In the meantime i use this one as a backup https://www.icloud.com/shortcuts/20a025ec4c494c4ba1dcfe159956b52d
Reply · 4 months, 4 weeks ago
@melzjoi
thanks for the backup link!
Reply · 4 months, 4 weeks ago
@Kpat80
YES, the shortcut is down right now. It likely will be down each time there is an update. Please be patient as the creator will likely update it when they have a chance. In the meantime I use this shortcut as a backup, it doesnt require Scriptable to work. (someone else is this thread created it,you'll obviously need to copy and paste the link into safari) https://www.icloud.com/shortcuts/20a025ec4c494c4ba1dcfe159956b52d
Reply · 4 months, 4 weeks ago
@Siannath
@petergam This is the very best shortcut I've ever used for getting PIP on TouTube. Thank you very much. A heads up: currently it does not work in latest iOS 15 beta. I will copy the error below. Exception Ocurred Error on lline 301:103: TypeError: undefined is not an object (evaluating `decoed.split("&").filter((line) => { return line.startsWith("player_response") }){0}.split')
Reply · 4 months, 3 weeks ago
@ahana_muskan
it doesn't work. keeps showing me error on line 300:35: sumn sumn... what should i do now? :(((
Reply · 4 months, 3 weeks ago
@loorkin
Now we just wait til there's another update. I wonder if it is better to turn off automatic YouTube updates, cuz when another one is out for YT the shortcut stops working immediately. There's an another shortcut which I use as a backup one: https://www.icloud.com/shortcuts/20a025ec4c494c4ba1dcfe159956b52d
Reply · 4 months, 3 weeks ago
@ahana_muskan
i'll make sure to turn off the update just in case. 💀 .. and thanks for the back up one
Reply · 4 months, 3 weeks ago
@beatdigger
With no updates or replies for over a month, it looks as if the creator of this shortcut has moved on to other projects.
Reply · 4 months, 3 weeks ago
@Q-Tip1775
Hello Peter, this shortcut comes in clutch! But I'm having a problem with it now it did work perfectly but now it doesn't my iPhone is iOS 14.6 and YouTube version 16.29.4, any suggestions to fix it I did do the update for scriptable as well. Thank you for your time! 07/31/2021
Reply · 4 months, 2 weeks ago
@jabb80
Hello! Thanks for your shortcuts!!! Could you fix a bug? Your shortcut doesn't work now :((
Reply · 4 months, 2 weeks ago
@kr0n0s
Hope this is updated soon! This is a handy shortcut when you're working and want some background noise!
Reply · 4 months, 2 weeks ago
@simoncveracity
For the attention of @petergam, the scriptable code is breaking when it goes off to YouTube, using `get_video_info` which now returns a 410 ("gone"). The equivalent output however, can be found using the `watch?v=` end point. You should find video formats within the `ytInitialPlayerResponse` (json) variable within the html it returns. e.g. https://youtube.com/watch?v=SA8ZBJWo73E returns html. `var ytInitialPlayerResponse` contains a json string: video formats are under: [streamingData][formats]
Reply · 4 months, 1 week ago
@Luke7486
This stopped working the past few weeks. Error on line 301:103
Reply · 4 months, 1 week ago
@Termy
Thank you for making this shortcut. It was blocked by YouTube again, so I fixed it. Here is the code to replace: let request = new Request(url) let encoded = await request.loadString() // let decoded = decodeURIComponent(encoded) var elements = encoded.split("ytInitialPlayerResponse = ") elements.shift() let response = elements.filter((part) => { return (part.search(";</script>") > 0) && !part.startsWith("null") })[0].split(";</script>")[0]
Reply · 4 months, 1 week ago
@Jcappelmann
@Termy Any chance you could share your working shortcut? My edit didn't work. I'm sure I'm doing something wrong. Thanks.
Reply · 4 months ago
@Termy
Here is my shared Link from the shortcut, I hope it also works for you. https://www.icloud.com/shortcuts/56eed546751c4cb4b2a10d49bb14e8e1
Reply · 4 months ago
@Kpat80
THANK YOU!!!!!! You're the goat!!!!
Reply · 4 months ago
@magnetmin
For me it was having trouble working with current and past livestreams as YouTube doesn't seem to return the streamdata for mobile requests, causing a "Unable to load stream" error message to appear. If you're having the same problem, add the string "?app=desktop" to the end of the mobile YouTube URL. If you want this to be done automatically, easiest way to do it would be to replace let url = configuration.url with let url = `${configuration.url}?app=desktop`
Reply · 4 months ago
@kr0n0s
Same here! I hope either the Shortcut author, or someone uploads the shortcut with the necessary code for streams.
Reply · 3 months, 3 weeks ago
@ckcu
Hello! Nice tool! But it no longer works on iOS 15 public beta 7. Could you please fix? Thanks.
Reply · 3 months, 3 weeks ago
@dee01
Why does it still give me error upon using it despite reinstalling it for 2days now?
Reply · 3 months, 2 weeks ago
@drawerapp
Here is a more reliable shortcut for anyone wants uninterrupted YouTube PIP experience. https://routinehub.co/shortcut/9496/
Reply · 3 months ago
@bengi
Getting this error on iOS 15 gm Exception Occurred Error on line 301:103: TypeError: undefined is not an object (evaluating 'decoded.split("&").filter ((line) => { return line.startsWith("player_re- sponse")H)[0].split')
Reply · 3 months ago
@bshane411
Not sure if you want to know, but I am getting an error when I run this script. "Error Occurred. Error occurred on line 301:103: TypeError: undefined is not an object (evaluating 'decoding.split("&")….etc etc". I am running iOS 14.7.1. Let me know if you need something else. Thanks again for developing this
Reply · 2 months, 3 weeks ago
@kr0n0s
Takes forever to load a video now. Any ideas on how to fix this?
Reply · 1 month, 2 weeks ago
@whydidyoubuyanewcar.com
For some reason my videos aren't playing in the PIP player and it just freezes on the first frame in the video.
Reply · 1 month, 1 week ago
@kr0n0s
Seems the app needs a total rework. It sporadically plays videos in a pop out or loads a frame from the video with de-synced audio and that's about it. If anyone could take a crack at fixing this? Or better yet, could someone recommend an alternative to this? It's a handy little shortcut and a shame to see it die out!
Reply · 1 week, 5 days ago
👋 Hey there! I see you have an ad blocker. I also hate ads and that's why I only serve ads from EthicalAds. They don't track or store your data at all! Please consider making an exception for EthicalAds or becoming a Member to help cover server costs and continued development of RoutineHub.
Dismiss for 7 days
Why Doesn'typutube Go Back to the Previous Video When I Press Back
Source: https://routinehub.co/shortcut/6622/
0 Response to "Why Doesn'typutube Go Back to the Previous Video When I Press Back"
إرسال تعليق