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

Music iframe do not follow the given width. #316

Closed
3 tasks done
gapplef opened this issue Jun 9, 2018 · 10 comments · Fixed by #1123
Closed
3 tasks done

Music iframe do not follow the given width. #316

gapplef opened this issue Jun 9, 2018 · 10 comments · Fixed by #1123

Comments

@gapplef
Copy link

gapplef commented Jun 9, 2018

I agree and want to create new issue


I use the follow code to insert music iframe, and set width=330 height=450.

<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=450
src="//music.163.com/outchain/player?type=0&id=739576121&auto=1&height=430"></iframe>

Expected behavior

This is the result with theme tranquilpeak, the width of music iframe is as expected.
screenshot from 2018-06-09 20-10-51

Actual behavior

When use theme next, the music iframe seems fit to the content width, and is much wider than the requirement.
screenshot from 2018-06-09 20-11-36

@sli1989
Copy link
Collaborator

sli1989 commented Jul 16, 2018

It can be controlled by the music iframe code.

<iframe frameborder="0" width="100%" height="100" src="http://v.qq.com/iframe/player.html?vid=m0178qd1etl&tiny=0&auto=0" allowfullscreen></iframe>

@gapplef
Copy link
Author

gapplef commented Jul 16, 2018

@sli1989 I think you misunderstand my problem.
I set the width of iframe to 330px, but the result is that it take the full width, which is not what I expected.
And this only happened for next theme, not others like tranquilpeak.
Also this only happend for music iframe, not videos.

@maple3142
Copy link
Contributor

Maybe you need quote in html attributes.

<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="450"
src="//music.163.com/outchain/player?type=0&id=739576121&auto=1&height=430"></iframe>

@gapplef
Copy link
Author

gapplef commented Jul 16, 2018

@maple3142 Actually, that's the default iframe code of NetEase Music, and after add quote, the result is still unchange.
Also I want to emphasise again that this only happened for next theme, not others like tranquilpeak in my test. That's why I think it's a bug of `next.

@ivan-nginx
Copy link
Member

@gapplef othe NexT schemes like Muse still have same bug?

@gapplef
Copy link
Author

gapplef commented Jul 16, 2018

@ivan-nginx yes, all have the same problem.

@ivan-nginx ivan-nginx added the Bug label Sep 13, 2018
@stevenjoezhang
Copy link
Contributor

stevenjoezhang commented Dec 1, 2018

In source/js/src/utils.js, remove

// Replace the iframe's dimensions and position the iframe absolute
// This is the trick to emulate the video ratio
$iframe.width('100%').height('100%')
.css({
position: 'absolute',
top : '0',
left : '0'
});

will solve the problem.
It seems to be a feature rather than a bug 🤔
See: iissnan/hexo-theme-next@ccc18c7#diff-a85f8cc577970acb809c7250f9ae27e2

@ivan-nginx
Copy link
Member

Maybe we can add option for 100% width or not here.
Let's add feature request on this issue.

@stevenjoezhang
Copy link
Contributor

@gapplef iframe of origin music.163.com will no longer be resized automatically now.

@gapplef
Copy link
Author

gapplef commented Aug 28, 2019

@stevenjoezhang thanks a lot.

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

Successfully merging a pull request may close this issue.

5 participants